mirror of
https://github.com/M66B/NetGuard.git
synced 2025-02-26 16:13:01 +00:00
Disable live traffic updates on pause
This commit is contained in:
parent
064f4922fe
commit
7c974c7278
1 changed files with 17 additions and 3 deletions
|
@ -147,13 +147,27 @@ public class ActivityLog extends AppCompatActivity {
|
||||||
});
|
});
|
||||||
|
|
||||||
live = true;
|
live = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
if (live) {
|
||||||
DatabaseHelper.addLogChangedListener(listener);
|
DatabaseHelper.addLogChangedListener(listener);
|
||||||
|
adapter = new LogAdapter(ActivityLog.this, dh.getLog());
|
||||||
|
lvLog.setAdapter(adapter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
if (live)
|
||||||
|
DatabaseHelper.removeLocationChangedListener(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
if (live)
|
|
||||||
DatabaseHelper.removeLocationChangedListener(listener);
|
|
||||||
dh.close();
|
dh.close();
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue