Set RequestFocus on first EditText in a dynamic ListView
At the moment im looping through a dynamic arraylist and building a
Listview with Switches and Edittexts from its data.
for (int i = 0; i < response.size(); ++i) {
...
xxx.SetId(i)
...
}
this was my working solution if a Edittext was on the first position:
if (i == 0 ) {
editText.requestFocus();
getWindow().setSoftInputMode
(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}
But how to set the focus on a Edittext if it's on for example third
position? (the position changes dynamically based on the arraylist)
No comments:
Post a Comment