I have a onClickListener
on a textview
and the textview has the flag that it's selectable
.
But the onclick
event I specified is only called when the textview
is clicked a second time.
After the second time it calles the onclick right, but if a other textview
that also is selectable
with a onclicklistener
it also is only called the second time, then it works fine, but then the other one works only the second time again. I can't find the source of this weird events.
telefoonTXT.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {startTelIntent();}}
);
urlTXT.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {startWebIntent();}
});
I faced this issue as well. Whenever text view is touched firstly
onTouch
, thenOnSelection
and at lastOnClick
is called. If i understand your problem clearly you want to select text in text view when userdouble taps
orlong presses
like the usual text selection but when user simply clicks it once u want theonClick
to function. I think the following might help you.Add a
gestureDetector
to your text View.set this ...
i think it will be work correctly