Code example for ToggleButton

Methods: isChecked

0
        }); 
	} 
 
	private void onButtonPress() { 
		// update the show-strongs pref setting according to the ToggleButton 
		CommonUtils.getSharedPreferences().edit().putBoolean("show_strongs_pref", mButton.isChecked()).commit();
		// redisplay the current page 
		PassageChangeMediator.getInstance().forcePageUpdate(); 
	} 
 
	public void update() { 
        boolean showStrongsToggle = canShow();
        mButton.setVisibility(showStrongsToggle? View.VISIBLE : View.GONE);
        if (showStrongsToggle) {
	        boolean isShowstrongs = CommonUtils.getSharedPreferences().getBoolean("show_strongs_pref", true);
	        mButton.setChecked(isShowstrongs);
        } 
	} 
 
	/** return true if Strongs are relevant to this doc & screen */ 
Connect your IDE to all the code out there  Get Codota for Java