Code example for CheckBox

Methods: setText, isChecked

0
		 
		voiceChoice.setOnCheckedChangeListener(new OnCheckedChangeListener()  {
			//@Override 
			public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
				// TODO Auto-generated method stub 
				if (!voiceChoice.isChecked())
				{ 
					voiceChoice.setText("Voice Recognition Off");
					voice = false;
					//turn off speech 
				} 
				else 
				{ 
					voiceChoice.setText("Voice Recognition On");
					voice = true;
					//turn on speech 
				} 
			} 
			 
		}); 
	}