Code example for Display

Methods: getMetrics

0
			if (wm != null)
			{ 
				Display d = wm.getDefaultDisplay();
				if (d != null)
				{ 
					d.getMetrics(metrics);
					return (int)(metrics.density*160.0f);
				} 
			} 
		} 
		return -1; 
    } 
     
    // =========================================================== 
 	// Functions for CCUserDefault 
 	// =========================================================== 
     
    public static boolean getBoolForKey(String key, boolean defaultValue) {
    	SharedPreferences settings = ((Activity)sContext).getSharedPreferences(Cocos2dxHelper.PREFS_NAME, 0);
    	return settings.getBoolean(key, defaultValue);
Contextual code suggestions in your IDE  Get Codota for Java