Code example for Resources

0
        WindowManager wm = (WindowManager)getContext().getSystemService(Context.WINDOW_SERVICE);
        wm.getDefaultDisplay().getMetrics(metrics);
 
        Configuration config = new Configuration();
        config.orientation = key.orientation;
        Resources r = new Resources(assets, metrics, config);
 
        mResourcesTable.put(key, new SoftReference<Resources>(r));
        return r;
    } 
 
    private synchronized void deleteResourcesForTheme(String packageName) {
        // When a theme package is uninstalled, remove all cached 
        // resource packages with the theme's package name. 
        for (PackageKey key : mResourcesTable.keySet()) {
            if (packageName.equals(key.packageName)) {
                mResourcesTable.remove(key);
            } 
        } 
    } 
Contextual code suggestions in your IDE  Get Codota for Java