Automatic popping up keyboard on start Activity

Galip picture Galip · Jan 12, 2011 · Viewed 98.8k times · Source

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 the virtual keyboard.

How can I prevent this?

Answer

Vikas Patidar picture Vikas Patidar · Jan 12, 2011

Use this attributes in your layout tag in XML file:

android:focusable="true"
android:focusableInTouchMode="true"

As reported by other members in comments it doesn't works on ScrollView therefore you need to add these attributes to the main child of ScrollView.