Some devices running new Android (4.0 and 3.0) see keyboard when my application starts. Why?

Go To StackoverFlow.com

0

I don't do anything with keyboard from my code, and I can't reproduce it on my phone running Android 2.3. But I saw it on tablet, keyboard pop-up when my app is started. What can cause this?

2012-04-05 20:19
by SuitUp


1

The keyboard might be triggered when an EditText gets focus as soon as your activity opens. I also faced this and fixed it by hiding the soft keyboard when the activity is created. Try adding the following code in onCreate:

getWindow().setSoftInputMode(
            WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
2012-04-05 20:55
by azertiti
Problem is, I don't have EditText View in my Activity, but I will try with this line of code. Thank you - SuitUp 2012-04-05 21:59
What element do you have - deadfish 2012-04-05 22:05
@Lumma admob, buttons, radiobuttons, textview, progressb ba - SuitUp 2012-04-05 23:52
@azertiti - I can't use this, because I added android:windowSoftInputMode="stateHidden|adjustPan" in my manifest, and with your line, my keyboard resize my app, not show above it - SuitUp 2012-04-05 23:55
omg, it was so late here, I didn't understand anything... I can use: this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFTINPUTSTATEALWAYSHIDDEN | WindowManager.LayoutParams.SOFTINPUTADJUST_PAN); or android:windowSoftInputMode="stateHidden|adjustPan" in my manifest, it is the same... - SuitUp 2012-04-06 01:25
Ads