Code example for TreeMap

0
    private List<Language> mAvailable;
    private WeakReference<Context> mContext;
 
    public LanguageManager(Context context) {
        mContext = new WeakReference<Context>(context);
        mSupported = new TreeMap<String, Language>();
        mAvailable = new ArrayList<Language>();
    } 
 
    public boolean loadLanguages() { 
        Context context = mContext.get();
 
        if (context == null)
            return false; 
 
        mDatapath = context.getExternalFilesDir(null);
 
        if (mDatapath == null) {
            return false; 
        }