Please tell me why is the following XML attribute used ? I looked up the documentation on developer.android.com but could not understand anything.
android:focusableInTouchMode
This blog post can help you to understand the meaning of touch mode.
The most relevant part :
The touch mode is a state of the view hierarchy that depends solely on the user interaction with the phone. By itself, the touch mode is something very easy to understand as it simply indicates whether the last user interaction was performed with the touch screen. For example, if you are using a G1 phone, selecting a widget with the trackball will take you out of touch mode; however, if you touch a button on the screen with your finger, you will enter touch mode. When the user is not in touch mode, we talk about the trackball mode, navigation mode or keyboard navigation, so do not be surprised if you encounter these terms. Finally, there is only one API directly related to touch mode, View.isInTouchMode().
So android:focusableInTouchMode="true"
means that the view can get the focus when the phone is in touch mode.
Typically an EditText
is generally focusable in touch mode and on the other hand a Button
is generally not focusable in touch mode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With