问题
I am able to long press a button and change its text using clipboard on 5.0 and above. On long pressing cursor appears and clipboard can be opened.
Any solution other that disabling the button ? I have tried setting onLongClickListener as null.Here is my button :
<Button
android:id="@+id/btn1"
style="@style/ButtonRegular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="@dimen/md_8dp_margin"
android:gravity="center"
android:minWidth="@dimen/width_280dp"
android:padding="12dp"
android:text="abc"
android:textColor="@color/white" />
In my app when you longpress clipboard can be opened to chnage button text
回答1:
It was my mistake. I was adding below line in button style which caused issue
<item name="android:inputType">textCapWords</item>
来源:https://stackoverflow.com/questions/37206806/possbile-to-long-press-button-and-change-its-text-in-android