How to keep soft keyboard from opening on activity launch in Android?

后端 未结 7 1812
Happy的楠姐
Happy的楠姐 2020-12-12 21:31

In an Android app, whenever the activity launches, the textbox gets the focus and the soft keyboard pops up automatically. I have tried to stop this by using following line

7条回答
  •  臣服心动
    2020-12-12 21:59

    The following code works for me

    ((InputMethodManager) iClockActivity
                        .getSystemService(Context.INPUT_METHOD_SERVICE))
                        .showSoftInput(textView, 0);
    

提交回复
热议问题