Search Inside SlidingMenu fragment

229 Views Asked by At

I have Right and left sliding menu using feinstein10 library. In the left menu i need to implement search for people from server(on each written letter i make a request). I thought about two options:

option 1:

onSearchViewClick make the menu list invisible, put another empty list, and fill it with received list from server. But i found it too messy to make a search inside a fragment. Even though, this would be the best option.

Option 2:

similar to facebook left menu; onSearchViewClicked start SearchActivity which would make all the search request and list. But i am stuck at requesting focus and on back button click the user is brought back to menu, with the searchView still focused and keyboard opened. I think this is not the most optimal solution.

Is there any way i could go for option1? or if not, how to manage the focuses of these searchViews?


Update

how to manage the focuses of these searchViews?

i click on SearchView from menu, the keyboard opens, the focus is on it, SearchActivity opens, keyboard is opened(from manifest, alwaysopen). in search activity requestfocus() does not help(with :focusable and :focusableInTouchMode). then i click back button, the keyboard is opened in menu, and the focus is on searchView. what i need to do is:

  1. get request on searchActivity
  2. remove keyboard and focus when i get back to menu from search activity

enter image description here

0

There are 0 best solutions below