1

I mumbled across SO and got some lines that made me able to remove the automatic focus and the rise of the virtual keyboard whenever I enter a new activity that has an edittext.

I successfully tested it on some of my android devices.

But recently, I was testing it on a lenovo tab, I realized that whenever I enter an activity, the keyboard is automatically being shown. (although the same thing does not happen on the LG device)

any ideas ?

tony9099
  • 4,095
  • 6
  • 35
  • 70
  • have you tried setFocusable(false) on this View? – Itzik Samara Aug 10 '14 at 18:20
  • setting it to whatever.setFocusable(false); totally disables the ability to even write inside the edittext – tony9099 Aug 10 '14 at 18:24
  • you can return the focus later if your need but since it doesnt works on some devices be sure that other devices you dont know will have the same issues so design it like all devices have the same issue. plus maybe write in your XML requestFocus() on other View even a invisible conhtrol just that keyboard wont open. – Itzik Samara Aug 10 '14 at 18:25

1 Answers1

0

Did you add this line in your manifest ?

 <activity android:name="com.yourpackage.YourActivityName"
 android:windowSoftInputMode="stateHidden"/>

For more Details check this links, it may help you. link 1. (How to hide Soft Keyboard when activity starts) link 2. (Stop EditText from gaining focus at Activity startup)

Community
  • 1
  • 1
SaravanaRaja
  • 2,444
  • 1
  • 18
  • 27