Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide keyboard on activity start on SearchView not working

I have a situation where I open SearchActivity and I want to have cursor in SearchView (keeping focus) while not showing keyboard at first. When and ONLY when user presses SearchView I want to show keyboard (cursor should be intact)

like image 435
MaaAn13 Avatar asked Nov 21 '25 19:11

MaaAn13


1 Answers

Add this below line in your activity.xml file's main layout

<LinearLayout
    ...
    android:focusableInTouchMode="true"
    ...
   >
like image 149
Chintak Patel Avatar answered Nov 23 '25 08:11

Chintak Patel