Keyboard shows up after starting Activity because of ScrollView
If my EditBox is not in a ScrollView, it won't open the keyboard automatically (which is good!) However, now it is included in one, it does this annoying thing every time I start the Activity. I already tried this, but it didn't work for me.
This is my main.xml: http://pastebin.com/qp3Nc8sf
Removing RequestFocus doesn't help either. How can I disable the keyboard on startup? Or is there even a better 开发者_如何学Cway of using scrollbars?
Thanks, Force
Have u tried adding this to your onCreate function of the activity:
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
Okay, I found the answer; I have to add android:windowSoftInputMode="stateUnchanged" to the activity in the manifest. This leaves the keyboard open while rotating as well. Nevertheless thanks for the answer Vinayak ;-)
精彩评论