Android App start with virtual keyboard open

后端 未结 3 825
旧时难觅i
旧时难觅i 2020-12-31 05:57

I am writing an app for android phones and after my splash screen it shows an activity which has several spinners and edittext views.

On an android device without

相关标签:
3条回答
  • 2020-12-31 06:06

    You can try this:

    Oncreate of your activity, set the input type to TYPE_NULL. Then, onTouch, set it to TYPE_CLASS_TEXT.

        myText.setInputType(InputType.TYPE_NULL);
    
        myText.setOnTouchListener(new View.OnTouchListener() {
            public boolean onTouch(View v, MotionEvent event) {
            myText.setInputType(InputType.TYPE_CLASS_TEXT);
            myText.onTouchEvent(event); // call native handler
            return true; // consume touch even
            } 
        });
    
    0 讨论(0)
  • 2020-12-31 06:10

    There are several more answers with another experience on this issue in thread Automatic popping up keyboard on start Activity

    0 讨论(0)
  • 2020-12-31 06:13

    You can try setting the android:windowSoftInputMode attribute of your Activity's entry in the AndroidManifest.xml file. I think setting it to stateHidden might do what you want.

    Here's the docs from the Android site.

    0 讨论(0)
提交回复
热议问题