简体   繁体   中英

how to display a keyboard automatically

When an activity is started, the keyboard should automatically get displayed without click of the edittext. I know that when we click the edittext, the keyboard is displayed. But I want that the keyboard should automatically get displayed. How to do this? Please reply.

You should consider adding android:windowSoftInputMode="stateAlwaysVisible" to your activity xml tag in AndroidManifest.xml . More details can be found in documentation .

<manifest ...>
    ...
    <application ...>
        <activity android:windowSoftInputMode="stateAlwaysVisible" ... />
    </application>
    ...    
</manifest>

Does this link solve your problem?

Show Soft Keyboard Automatically

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM