Initially I wanted a checkmark where the text is placed on the left of the checkmark. After searching on this site I found out the best workaround is android:CheckedTextView
simple answer is to add your own onClickListener, and use : isChecked()
method instead of isSelected()
.
CheckedTextView chkBox = (CheckedTextView) findViewById(R.id.CheckedTextView01);
chkBox.setOnClickListener(new View.OnClickListener() {
public void onClick(View v)
{
if(((CheckedTextView) v).isChecked()){
((CheckedTextView) v).setChecked(false);
}else{
((CheckedTextView) v).setChecked(true);
}
}
});
and get the status using view.isChecked()
method.