Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] check if the map is destroyed before saving state in a frag…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
LukasPaczos committed Sep 4, 2018
1 parent 69b7c2f commit 18b43f2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ public void onPause() {
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
map.onSaveInstanceState(outState);
if (map != null && !map.isDestroyed()) {
map.onSaveInstanceState(outState);
}
}

/**
Expand All @@ -183,7 +185,9 @@ public void onStop() {
@Override
public void onLowMemory() {
super.onLowMemory();
map.onLowMemory();
if (map != null && !map.isDestroyed()) {
map.onLowMemory();
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ public void onPause() {
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
map.onSaveInstanceState(outState);
if (map != null && !map.isDestroyed()) {
map.onSaveInstanceState(outState);
}
}

/**
Expand All @@ -178,7 +180,9 @@ public void onStop() {
@Override
public void onLowMemory() {
super.onLowMemory();
map.onLowMemory();
if (map != null && !map.isDestroyed()) {
map.onLowMemory();
}
}

/**
Expand Down

0 comments on commit 18b43f2

Please sign in to comment.