Code example for WeakHashMap

Methods: getput

         * @param file The name of the type face asset. 
         * @param context The {@link Context} to use. 
         * @return A new type face. 
        public Typeface getTypeface(final String file, final Context context) {
            Typeface result = MAP.get(file);
            if (result == null) {
                result = Typeface.createFromAsset(context.getAssets(), file);
                MAP.put(file, result);
            return result;
Contextual code suggestions in your IDE  Get Codota for Java