Code example for TreeMap

Methods: getkeySetputAll

	public Object getItem(int arg0) {		
		Map<String, String> prefs = (Map<String,String>)mPreferences.getAll();
		TreeMap<String, String> sortedPrefs = new TreeMap<String, String>();
		String key = sortedPrefs.keySet().toArray()[arg0].toString();
		HashMap<String, String> hm = new HashMap<String, String>();
		hm.put(key, sortedPrefs.get(key).toString());
		return hm;
	public long getItemId(int arg0) {		
		return arg0;
Connect your IDE to all the code out there  Get Codota for Java