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 the first available Edittext? for example third position after two switches? (the position changes dynamically based on the arraylist)