I need to display a virtual keyboard when the application starts, but so far I have failed.
I use this code in the "OnCreate" method to display the virtual keyboard
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(txtBuscar.getId(), InputMethodManager.SHOW_FORCED);
this code works fine on any screen at any time, but does not work when the "first" activity begins. Why?
I tried this when I started another activity, and it works, but it doesn’t work when I start the “first” activity.
I tried to put this code in "OnCreate" events and many others .... but it seems like it is not working.
Is there a "force" to display the keyboard when the application starts?
Thanks in advance.
source
share