Restoring search query after orientation change
This commit is contained in:
parent
6d6b8363a8
commit
eb66cc5db8
|
@ -313,14 +313,17 @@ public class VideoItemListActivity extends AppCompatActivity
|
||||||
findViewById(R.id.videoitem_detail_container) == null) {
|
findViewById(R.id.videoitem_detail_container) == null) {
|
||||||
inflater.inflate(R.menu.videoitem_list, menu);
|
inflater.inflate(R.menu.videoitem_list, menu);
|
||||||
MenuItem searchItem = menu.findItem(R.id.action_search);
|
MenuItem searchItem = menu.findItem(R.id.action_search);
|
||||||
SearchView searchView = (SearchView) searchItem.getActionView();
|
final SearchView searchView = (SearchView) searchItem.getActionView();
|
||||||
searchView.setFocusable(false);
|
searchView.setFocusable(false);
|
||||||
searchView.setOnQueryTextListener(
|
searchView.setOnQueryTextListener(
|
||||||
new SearchVideoQueryListener());
|
new SearchVideoQueryListener());
|
||||||
suggestionListAdapter = new SuggestionListAdapter(this);
|
suggestionListAdapter = new SuggestionListAdapter(this);
|
||||||
searchView.setSuggestionsAdapter(suggestionListAdapter);
|
searchView.setSuggestionsAdapter(suggestionListAdapter);
|
||||||
searchView.setOnSuggestionListener(new SearchSuggestionListener(searchView));
|
searchView.setOnSuggestionListener(new SearchSuggestionListener(searchView));
|
||||||
|
if(!searchQuery.isEmpty()) {
|
||||||
|
searchView.setQuery(searchQuery,false);
|
||||||
|
searchView.setIconifiedByDefault(false);
|
||||||
|
}
|
||||||
} else if (videoFragment != null){
|
} else if (videoFragment != null){
|
||||||
videoFragment.onCreateOptionsMenu(menu, inflater);
|
videoFragment.onCreateOptionsMenu(menu, inflater);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue