Code example for ToggleButton

Methods: getText

0
 
			@Override 
			public void onClick(View v) {
				// TODO Auto-generated method stub 
				// Log.d("aaaaaaaaaaa", "togg" + toggleButton1.getText()); 
				if (toggleButton1.getText().toString().equalsIgnoreCase("on")) {
					showDurationList(); 
 
				} else { 
					Editor edit = sp.edit();
					edit.putBoolean("spAutoUpdate", false);
					edit.commit();
					changeDur.setVisibility(View.GONE);
				} 
			} 
		}); 
	} 
 
	public void showDurationList() { 
		AlertDialog.Builder builder = new AlertDialog.Builder(m_context);
		builder.setTitle("Live score Auto update duration");