focus of EditText in android
This question already has an answer here:
First test in your xml file that you may have this line in your edit text <requestFocus />
remove it, and here is some example which can help you Example link
<EditText
android:id="@+id/name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<-- remove this line /// <requestFocus />
</EditText>
also add this in your activity
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
在你的layout.xml中,删除这行(在EditText的底部):
<requestFocus />
最好的解决方案是:(在Manifest文件中)
<activity android:name=".MainActivity"
android:windowSoftInputMode="stateHidden" />
链接地址: http://www.djcxy.com/p/24172.html