Disable autofocus of EditText at Activity startup
This question already has an answer here:
Answer :
For Activity: place the below code into your onCreate() method
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
For Fragment: place the below code into your onCreateView() method
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
链接地址: http://www.djcxy.com/p/24174.html上一篇: 如何防止关注活动开始