Unable to get keyboard to load onCreate ()

My goal is to open the keyboard as soon as the application is downloaded. Using this code,

InputMethodManager inputMgr = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); inputMgr.toggleSoftInput(0, 0);` 

on the button, I can get the keyboard to load when the button is pressed. However, when placed in the override section onCreate (), nothing happens.

+4
source share
1 answer

Add the following line to the action in AndroidManifest.xml

 android:windowSoftInputMode="stateVisible|adjustPan" 
+8
source

Source: https://habr.com/ru/post/1336208/


All Articles