I have some edit texts in my Scroll Layout.
On the bottom, I have a button.
Actually, on each opening of the view, the first editText requests the focus automaticaly. I would like that the button gets the focus.
I have try this, but without success:
final ScrollView s = (ScrollView)findViewById(R.id.ScrollView01);
s.post(new Runnable() {
public void run() {
Button button =(Button) findViewById(R.id.SaveProfileEditingButton);
button.requestFocus();
}
});
Thank you for your hlep.
Set
android:windowSoftInputMode="stateHidden"to your activity in AndroidManifest.xml to hide the keyboard (opened due to focus on EditText). Afterwards your other views may receive the focus.Update