Code example for Resources

Methods: getConfigurationgetDisplayMetrics

0
 
		final Configuration mLastConfiguration = new Configuration();
		int mLastDensity;
 
		boolean applyNewConfig(final Resources res) {
			final int configChanges = mLastConfiguration.updateFrom(res.getConfiguration());
			final 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 {