Code example for Field

Methods: setAccessiblesetBoolean

0
			try { 
				ViewConfiguration config = ViewConfiguration.get(context);
				Field menuKeyField = ViewConfiguration.class
						.getDeclaredField("sHasPermanentMenuKey");
				if (menuKeyField != null) {
					menuKeyField.setAccessible(true);
					menuKeyField.setBoolean(config, value);
				} 
			} catch (Exception ex) {
				// Simply ignore. This is a hack anyways. 
			} 
		} 
	} 
	 
	public static boolean isNetworkAvailable(Context context) {
	    ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
	    NetworkInfo networkInfo = cm.getActiveNetworkInfo();
 
	    if (networkInfo != null && networkInfo.isConnected()) {
	        return true; 
Stop searching for code, let great code find you!  Add Codota to your java IDE