Code example for ToggleButton

Methods: toggle

0
		activateToggleButton.setOnClickListener(new OnClickListener() {
			 
			@Override 
			public void onClick(View v) {
				Log.i(TAG, "Activate toggle button clicked. Changing the state of the toggle button");
				toggleButton.toggle();
			} 
		}); 
		 
		toggleButton.setOnCheckedChangeListener(new OnCheckedChangeListener() {
			 
			@Override 
			public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
				Log.i(TAG, "Toggle state changed!");
				helloText.setText("Toggle active? " + isChecked);
			} 
		}); 
		 
		nextButton.setOnClickListener(new OnClickListener() {
			 
			@Override