How to set focus on a view when a layout is created and displayed?


Question

Currently, I have a layout which contains a Button, a TextView and an EditText. When the layout is displayed, the focus will be automatically put on the EditText, which will trigger the keyboard to show up on Android phone. It is not what I want. Is there any way that I can set the focus on TextView or on nothing when a layout is displayed?

1
89
12/8/2017 6:48:42 PM

Set focus: The framework will handled moving focus in response to user input. To force focus to a specific view, call requestFocus()

102
1/27/2010 10:11:38 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon