Code example for CheckBox

Methods: setText, setChecked

0
			super(context, attrs);
			init(title, false);
		} 
 
		private void init(String title, boolean isChecked) {
			chkItem = new CheckBox(p());
			chkItem.setChecked(isChecked);
			chkItem.setText(title);
			addView(chkItem);
		} 
		 
		private PasswordMakerEditFavorites p() { 
			return PasswordMakerEditFavorites.this;
		} 
		 
		public boolean isChecked() { 
			return chkItem.isChecked();
		} 
		 
		public String getTitle() {
			return chkItem.getText().toString();
		} 
		 
		public void setChecked(boolean checked) {
			chkItem.setChecked(checked);
		} 
		 
		public void setTitle(String title) {
			chkItem.setText(title);
		}