mirror of
https://github.com/M66B/NetGuard.git
synced 2024-12-23 08:17:51 +00:00
Close search view on refresh
This commit is contained in:
parent
421866c496
commit
b879e83c5f
1 changed files with 4 additions and 1 deletions
|
@ -37,6 +37,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
|||
|
||||
private boolean running = false;
|
||||
private RuleAdapter adapter = null;
|
||||
private MenuItem searchItem = null;
|
||||
|
||||
private static final int REQUEST_VPN = 1;
|
||||
|
||||
|
@ -149,6 +150,8 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
|||
@Override
|
||||
protected void onPostExecute(List<Rule> result) {
|
||||
if (running) {
|
||||
if (searchItem != null)
|
||||
MenuItemCompat.collapseActionView(searchItem);
|
||||
adapter = new RuleAdapter(result, ActivityMain.this);
|
||||
rvApplication.setAdapter(adapter);
|
||||
}
|
||||
|
@ -176,7 +179,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
|||
inflater.inflate(R.menu.main, menu);
|
||||
|
||||
// Search
|
||||
MenuItem searchItem = menu.findItem(R.id.menu_search);
|
||||
searchItem = menu.findItem(R.id.menu_search);
|
||||
SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
|
||||
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue