In a project, as soon as you enter a page, EditText automatically gets the focus by default.
So how do you cancel this default behavior?
Looking for a long time on the internet, a bit of listening to soft keyboard events, a bit called Clearfouse () method, but the test has not! The corresponding property could not be found in the XML to turn off this default behavior
Solution: Find one in the parent control of the EditText, set to
Copy Code code as follows:
Android:focusable= "true"
Android:focusableintouchmode= "true"
In this way, the default behavior of the EditText is truncated!
Copy Code code as follows:
<linearlayout
style= "@style/fillwrapwidgetstyle"
Android:o rientation= "vertical"
android:background= "@color/black"
android:gravity= "Center_horizontal"
Android: Focusable= "true"
Android:focusableintouchmode= "true"
>
<imageview
android:id= "@+id/logo" br>style= "@style/wrapcontentwidgetstyle"
android:background= "@drawable/dream_dictionary_logo"
/>
& Lt Relativelayout
style= "@style/fillwrapwidgetstyle"
android:background= "@drawable/searchbar_bg"
Android : gravity= "center_vertical"
>
<edittext
android:id= "@+id/searchedittext"
style= "@style/wrapco Ntentwidgetstyle "
android:background=" @null
android:hint= "Search"
android:layout_marginleft= "40DP"
android:singleline= "true"
/>
</RelativeLayout>
</LinearLayout>