Code example for ToggleButton

Methods: getText

0
			@Override 
			public void onClick(View v) 
			{ 
 
				StringBuffer result = new StringBuffer();
				result.append("toggleButton1 : ").append(toggleButton1.getText());
				result.append("\ntoggleButton2 : ").append(toggleButton2.getText());
 
				Toast.makeText(MainActivity.this, result.toString(),Toast.LENGTH_SHORT).show();
			} 
		}); 
 
	} 
}