Code example for LruCache

0
	    final int memClass = ((ActivityManager)getSystemService(Context.ACTIVITY_SERVICE)).getMemoryClass();
 
	    // Use 1/8th of the available memory for this memory cache. 
	    final int cacheSize = 1024 * 1024 * memClass / 8;
	    api = new TreeAPI();
	    mMemoryCache = new LruCache<String, TreeFile>(cacheSize);	    
	    yourHome = getSharedPreferences(PREF_NAME, 0).getString("home", null);
	    new PrefetchFiles(api).execute(yourHome);
	} 
	 
	public String getYourHome() {
		if(yourHome == null){
			yourHome = getSharedPreferences(PREF_NAME, 0).getString("home", null);
		} 
		return yourHome;
	} 
 
	public void setYourHome(String yourHome) {
		TheFileTreeApp.yourHome = yourHome;
		SharedPreferences settings = getSharedPreferences(PREF_NAME, 0);
Stop searching for code, let great code find you!  Add Codota to your java IDE