Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android : How change focus on form with out user action?

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>
like image 378
NicoMinsk Avatar asked Apr 20 '10 19:04

NicoMinsk


People also ask

How do I turn off focus on Android?

Block Interruptions. On Android's Digital Wellbeing screen, tap Focus Mode. Choose the Set a Schedule option to block out the timeout you need from your phone. In the “Your distracting apps” list, select the programs you'd like to disable when Focus Mode is on.


1 Answers

Call requestFocus() on the password field.

http://developer.android.com/reference/android/view/View.html#requestFocus()

like image 143
Mark B Avatar answered Oct 12 '22 04:10

Mark B