views:

508

answers:

1

Hello,

I've a form with 2 fields, after First login, i store the Mail in SharedPreferences and i restore when user start app again, But how to set focus on Pass Field ? it's not very nice to see that mail is fill but focus is still on mail field.

Thanks

<EditText 
android:id="@+id/Email" 
android:text="" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content"
android:layout_below="@+id/labelEmail" 
android:inputType="textEmailAddress"
android:padding="10px">
</EditText>

<EditText 
android:id="@+id/Pass"  
android:text=""
android:layout_width="fill_parent" 
android:layout_height="wrap_content"
android:layout_below="@+id/labelPass" 
android:padding="10px"
android:inputType="textPassword"
android:password="true">
</EditText>
+1  A: 

Call requestFocus() on the password field.

http://developer.android.com/intl/zh-CN/reference/android/view/View.html#requestFocus()

mbaird
Thanks it's works!
NSchubhan