Use this attributes in your layout tag in XML file:
android:focusable="true"
android:focusableInTouchMode="true"
As reported by other members in comments it doesn’t works on ScrollView
therefore you need to add these attributes to the main child of ScrollView
.
More Related Contents:
- How to show soft-keyboard when edittext is focused
- How to stop EditText from gaining focus at Activity startup in Android
- How to stop EditText from gaining focus when an activity starts in Android?
- Android: show soft keyboard automatically when focus is on an EditText
- Disable keyboard on EditText
- Android: Force EditText to remove focus? [duplicate]
- EditText, clear focus on touch outside
- Set Focus on EditText
- How do I show the number keyboard on an EditText in android?
- How can I set the focus (and display the keyboard) on my EditText programmatically
- Stop ScrollView from setting focus on EditText
- Soft Keyboard shows up on EditText focus ONLY once
- EditText with soft keyboard and “Back” button
- Focus on EditText in ListView when block descendants (Android)
- AlertDialog with EditText, open soft keyboard automatically with focus on EditText doesn’t work
- Edit Text in ListActivity ListView loses focus when keyboard comes up
- How to change the floating label color of TextInputLayout
- Android: How can I validate EditText input?
- Multiline EditText with Done SoftInput Action Label on 2.3
- Android getText from EditText field
- How to disable keypad popup when on edittext?
- How To Set Text In An EditText
- How to mask an EditText to show the dd/mm/yyyy date format
- EditText in Listview loses focus when pressed on Android 4.x
- Android RecyclerView: Change layout file LIST to GRID onOptionItemSelected
- Disable EditText context menu
- change font for editText hint
- Android EditText Gmail like to field
- Get back key event on EditText
- Android Hide Soft Keyboard from EditText while not losing cursor