Android onLongClick bug with TextView

85 views Asked by At

I've a strange bug with TextView in RelativeLayout. After setting OnClickListener to RelativeLayout, when I press relativeLayout for long (that is OnLongClick) there appears a popup with button "paste". After pressing "paste" a text from buffer pastes into textView (which is inside RelativeLayout). I'm confused, is it google's side bug, or I made something incorrectly?

3

There are 3 answers

0
Kuanysh Zhunussov On BEST ANSWER

I've found solution. It's strange as a problem. Several bugs appears after adding <item name="android:inputType">textFilter|textNoSuggestions</item> to styles. I don't why, but after removing this line, all things becomes right. It was one more bug - all TextViews becomes singleLine

0
AterLux On

do not forget to do

setLongClickable(true);

on your View (in constructor, or onCreate)

1
ArtemStorozhuk On

This is default Android's behaviour - this popup is called context menu. You can try long-pressing any other text/edit view in another application and result will be the same - this menu will be shown.