From b2d935dd6d8fda9806bc8ef8ab8307d2dc7641d0 Mon Sep 17 00:00:00 2001 From: madiyar Date: Mon, 7 Mar 2016 13:05:05 +0600 Subject: [PATCH] Restoring search query after orientation change in two pane mode --- .../main/java/org/schabi/newpipe/VideoItemListActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java b/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java index 86c292da5..392cd80db 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java @@ -244,6 +244,9 @@ public class VideoItemListActivity extends AppCompatActivity // the support version on SearchView, so it needs to be set programmatically. searchView.setIconifiedByDefault(false); searchView.setIconified(false); + if(!searchQuery.isEmpty()) { + searchView.setQuery(searchQuery,false); + } searchView.setOnQueryTextListener(new SearchVideoQueryListener()); suggestionListAdapter = new SuggestionListAdapter(this); searchView.setSuggestionsAdapter(suggestionListAdapter); @@ -313,7 +316,7 @@ public class VideoItemListActivity extends AppCompatActivity findViewById(R.id.videoitem_detail_container) == null) { inflater.inflate(R.menu.videoitem_list, menu); MenuItem searchItem = menu.findItem(R.id.action_search); - final SearchView searchView = (SearchView) searchItem.getActionView(); + SearchView searchView = (SearchView) searchItem.getActionView(); searchView.setFocusable(false); searchView.setOnQueryTextListener( new SearchVideoQueryListener());