Code example for Configuration

Methods: updateFrom

0
    public static class InterestingConfigChanges { 
        final Configuration mLastConfiguration = new Configuration();
        int mLastDensity;
 
        boolean applyNewConfig(Resources res) {
            int configChanges = mLastConfiguration.updateFrom(res.getConfiguration());
            boolean densityChanged = mLastDensity != res.getDisplayMetrics().densityDpi;
            if (densityChanged || (configChanges&(ActivityInfo.CONFIG_LOCALE
                    |ActivityInfo.CONFIG_UI_MODE|ActivityInfo.CONFIG_SCREEN_LAYOUT)) != 0) {
                mLastDensity = res.getDisplayMetrics().densityDpi;
                return true; 
            } 
            return false; 
        } 
    } 
 
    /** 
     * Helper class to look for interesting changes to the installed apps 
     * so that the loader can be updated. 
     */ 
    public static class PackageIntentReceiver extends BroadcastReceiver {