Code example for SoftReference

0
	} 
 
	private static void putStringForSoftReference(String requestUrl,
			String result) {
		// TODO Auto-generated method stub 
		SoftReference<String> referece = new SoftReference<String>(result);
		RequestCache.put(requestUrl, referece);
	} 
 
	private static String getStringFromWeb(Context context, String requestPath,
			String requestUrl, String source_type, String content_type,
			DBHelper dbHelper) {
		// TODO Auto-generated method stub 
		String result = "";
		try { 
			result = HttpUtils.getByHttpClient(context, requestUrl);
			if (result.equals(null) && result.equals("")) {
				return result;
			} 
			// 更新数据库 
			Cursor cursor = getStringFromDB(requestUrl, dbHelper);