I have a SearchView
on my Toolbar
. I works perfectly and I have no problem with it.
But the problem arises whenever I write some search term on the EditText of the SearchView and long-click on the text, the toolbar transforms into a contextual menu with paste, copy, etc options.
This also happened in other EditTexts of my app, but I solved it using
android:longClickable="false"
This entirely disables long-click event on the EditTexts and the context menu never appears. This is the behavior I want.
But how can I do the same for the SearchView? I tried to disable long-click on the SearchView but that doesn't work.
How can I reference the EditText of the SearchView and then disable the long-click event? Or is there any other better approach?