I am developing an android application and have a problem in the following scenario:
- on first activity list user touches a list item
- a dialog window with a list of subcategories for the selected item pops up
- the user selects a subcategory
- the next activity starts with the selected item and subcategory. Note that:
- the first element on the next activity screen is an EditText field
- the second element on the next activity is a button and
in the
onCreate()
method I set focus on the buttonspeakNameBtn.requestFocus();
and here the problem becomes: if the user selects a subcategory in step 3 by touching it in the list, on the next screen the user sees the popup keyboard and the EditText
field, not the button, has the focus.
Question - how can I prevent that keyboard to show up?
It seems that touch event on the first screen dialog somehow propagated to the next activity. If I use the ball to select a subcategory instead of touching it, everything works as expected - the focus set on the button and I do not see the keyboard.
Any thoughts would be greatly appreciated.