Automatic popping up keyboard on start Activity

后端 未结 19 1054
醉梦人生
醉梦人生 2020-11-28 23:05

I got a relative simple question. I have an activity with a lot of EditText\'s in them. When I open the activity it automatically focusses to the first EditText and displays

19条回答
  •  离开以前
    2020-11-28 23:29

    Use this in your Activity's code:

    @Override
    public void onCreate(Bundle savedInstanceState) {
    
    getWindow().setSoftInputMode(
       WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
    
    }
    

提交回复
热议问题