[android] - clear callbacks as part of OnDestroy not as part of OnDestroyView

This commit is contained in:
tobrun
2019-03-05 10:33:03 +01:00
committed by Tobrun
parent 383fde6804
commit be75dc9a48
8 changed files with 94 additions and 7 deletions

View File

@@ -198,6 +198,14 @@ public final class MapFragment extends Fragment implements OnMapReadyCallback {
public void onDestroyView() {
super.onDestroyView();
map.onDestroy();
}
/**
* Called when the fragment is destroyed.
*/
@Override
public void onDestroy() {
super.onDestroy();
mapReadyCallbackList.clear();
}

View File

@@ -187,12 +187,20 @@ public class SupportMapFragment extends Fragment implements OnMapReadyCallback {
}
/**
* Called when the fragment is view hiearchy is being destroyed.
* Called when the fragment is view hierarchy is being destroyed.
*/
@Override
public void onDestroyView() {
super.onDestroyView();
map.onDestroy();
}
/**
* Called when the fragment is destroyed.
*/
@Override
public void onDestroy() {
super.onDestroy();
mapReadyCallbackList.clear();
}