How can i make textview Clickable false ? I tried with textView.setClickable(false)
but it is not working i add my snippet below.
t1 = (TextView)findViewById(R.id.text_View1);
t1.setClickable(false);
//t1.setFocusableInTouchMode(false);
//t1.setEnabled(false);
t1.setFocusable(false);
t1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
t1.setText("clicked");
}
});
But when i click on textview text is change kindly help me.
You need fully disable TextView:
t1.setEnabled(false);
try to change the listener position like this
t1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
t1.setText("clicked");
}
});
t1.setClickable(false);
//t1.setFocusableInTouchMode(false);
//t1.setEnabled(false);
t1.setFocusable(false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With