I am have some trouble controlling when the keyboard comes up. What I want to do is have the native keyboard to appear with the focus in a particular input field when I show a certain Form. The user is cycling through a list and imputing values. For each value a new Form appears. The user cycles through the Forms with a Back button, a Next button, Done on the keyboard native keyboard, or a event listener for a barcode scanner.
The current solution I have is by simulating a click in the onShowCompleted()
@Override
protected void onShowCompleted() {
countedTextField.pointerPressed(0, 0);
countedTextField.pointerReleased(0, 0);
}
This works for when I use the Back, Next, or Done because the keyboard will close automatically on clicking on a button on the form or through the done button on the keyboard. However when the switch is made by the barcode scanner, just a listener, it seems like it loads the new Form and then lowers the keyboard after the onShowCompleted and the pointerPressed/Released have no effect.
I tried a few ways of trying to detect if the keyboard is up by checking the display height but it lead to very inconsistent results. I have also tried to make a native android interface to force the keyboard to lower but I was not able to get that to work properly.
Any ideas of how to get the keyboard to automatically come up upon showing a form or to force the keyboard to lower if it is up?