• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Application scroll to first edit field on start up.

Droid_Coder

Newbie
Hi,

I'm debugging my first Android app and when running in the emulator it seems fine. The main view appears and no edit fields have focus. I see the full screen including the introduction text at the top.

When I start this on my Vodafone 858 Smart phone, the view scrolls down to the first edit field (which is a phone number field) and also pops up the number pad. I have removed the 'focus' tags from my mains.xml, so I do not see why it's scrolling to the first edit field.

Android SDK 2.2 (8)

Any suggestions on what I can modify to prevent this?

Cheers...
 
I sorted this out. I found this little trick after many google searchs. I added the following lines to the beginning of my main LinearLayout section, just prior to the TextView I set up for my title.

<LinearLayout android:focusable="true" android:focusableInTouchMode="true" android:layout_width="0px" android:layout_height="0px"/><requestFocus></requestFocus>
 
Back
Top Bottom