0

In my main layout I have a pull to refresh list view and a button at the top, on button click a normal list view appears on top of this main layout, but even after the appearance of this list view, the focus is still with the below main layout.

what can I do to bring the focus to the list view ?

Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142

2 Answers2

0

You can clear the focus

button.clearFocus();

or in listview request focus

listView.requestFocus();
Rashid
  • 1,700
  • 1
  • 23
  • 56
0

Try doing setSelection() for particular item in listView,

CheckOut set focus on any item of listview in android stack answer.

Either you have to

Use setSelection to some item :

mListView.setSelection(position);

OR

focussing you have to use may not work :

mListView.requestFocus();
Community
  • 1
  • 1
Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142