mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Always keep models
This commit is contained in:
parent
dea9355766
commit
5f6c34f7c6
1 changed files with 2 additions and 6 deletions
|
@ -195,11 +195,7 @@ public class ViewModelMessages extends ViewModel {
|
|||
owner.getLifecycle().addObserver(new LifecycleObserver() {
|
||||
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
|
||||
public void onDestroyed() {
|
||||
int free_mb = Log.getFreeMemMb();
|
||||
boolean lowmem = (free_mb < LOW_MEM_MB);
|
||||
|
||||
Log.d("Destroy model=" + viewType +
|
||||
" lowmem=" + lowmem + " free=" + free_mb + " MB");
|
||||
Log.d("Destroy model=" + viewType);
|
||||
|
||||
Model model = models.get(viewType);
|
||||
if (model != null) {
|
||||
|
@ -207,7 +203,7 @@ public class ViewModelMessages extends ViewModel {
|
|||
model.list.removeObservers(owner);
|
||||
}
|
||||
|
||||
if (viewType == AdapterMessage.ViewType.THREAD || lowmem) {
|
||||
if (viewType == AdapterMessage.ViewType.THREAD) {
|
||||
Log.d("Remove model=" + viewType);
|
||||
models.remove(viewType);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue