1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2024-12-22 07:43:15 +00:00

Fixed updating filtered data

This commit is contained in:
M66B 2024-12-07 08:03:09 +01:00
parent f65c7d247d
commit 1d2a5c8958

View file

@ -525,11 +525,18 @@ public class ActivityLog extends AppCompatActivity implements SharedPreferences.
boolean other = prefs.getBoolean("proto_other", true); boolean other = prefs.getBoolean("proto_other", true);
boolean allowed = prefs.getBoolean("traffic_allowed", true); boolean allowed = prefs.getBoolean("traffic_allowed", true);
boolean blocked = prefs.getBoolean("traffic_blocked", true); boolean blocked = prefs.getBoolean("traffic_blocked", true);
adapter.changeCursor(DatabaseHelper.getInstance(this).getLog(udp, tcp, other, allowed, blocked));
String query = null;
if (menuSearch != null && menuSearch.isActionViewExpanded()) { if (menuSearch != null && menuSearch.isActionViewExpanded()) {
SearchView searchView = (SearchView) menuSearch.getActionView(); SearchView searchView = (SearchView) menuSearch.getActionView();
adapter.getFilter().filter(getUidForName(searchView.getQuery().toString())); if (searchView != null)
query = getUidForName(searchView.getQuery().toString());
} }
if (TextUtils.isEmpty(query))
adapter.changeCursor(DatabaseHelper.getInstance(this).getLog(udp, tcp, other, allowed, blocked));
else
adapter.changeCursor(DatabaseHelper.getInstance(ActivityLog.this).searchLog(query));
} }
} }