How to clear focus for EditText?

前端 未结 8 1100
滥情空心
滥情空心 2021-01-30 12:54

I have an activity with a search box (EditText) on the top, and a ListView below. Whenever the activity starts, the EditText always has focus and bring up the keybo

相关标签:
8条回答
  • 2021-01-30 13:53

    Try this

    On your Activity Declaration in AndroidManifest.xml add the below code :

    android:windowSoftInputMode="stateHidden"
    

    It will prevent the keyboard to popup up when activity becomes visible.

    Happy coding :)

    0 讨论(0)
  • 2021-01-30 13:59

    Here is the answer EditText, clear focus on touch outside.

    Or you can just write widget which will show only text with textView and onClickwill display dialog with EditText where you can edit this text/

    0 讨论(0)
提交回复
热议问题