How to remove focus from SearchView?

前端 未结 10 1493
野趣味
野趣味 2021-02-06 22:20

I want to remove focus and text from SearchView in onResume().

I tried searchView.clearFocus() but it is not working.

Thi

10条回答
  •  执念已碎
    2021-02-06 22:52

    when in activity go to parent layout ,and in fragment too also do the same thing in framelayout. Just add this attribute:

    android:focusableInTouchMode="true"
    

提交回复
热议问题