I am developing an Android application and have a problem in the following scenario:
- in the first activity list, the user touches the list item
- A dialog box appears listing the subcategories for the selected item.
- user selects a subcategory
- The next action starts with the selected item and subcategory. Note that:
- the first item on the next activity screen is the EditText field
- the second element of the next action is the button and in the method
onCreate()I focused 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 a pop-up menu, and the field EditText, and not the button, has focus.
Question. How can I prevent this keyboard from appearing?
It seems that the touch event in the first dialogue of the screen somehow extended to the next action. If I use the ball to select a subcategory, rather than touching it, everything works as expected - the focus is on the button and I don’t see the keyboard.
Any thoughts would be greatly appreciated.
Damir source
share