YS
Size: a a a
YS
YS
P▽
abstract class BaseFragment: MvpAppCompatFragment(), ....
override fun onDestroy() {
super.onDestroy()
//We leave the screen and respectively all fragments will be destroyed
if (activity.isFinishing) {
mvpDelegate.onDestroy()
return
}
// When we rotate device isRemoving() return true for fragment placed in backstack
// http://stackoverflow.com/questions/34649126/fragment-back-stack-and-isremoving
if (isStateSaved) {
isStateSaved = false
return
}
if (isRemoving) {
mvpDelegate.onDestroy()
}
mapView.onDestroy()
}
public void onDestroy() {
super.onDestroy();
if (this.getActivity().isFinishing()) {
this.getMvpDelegate().onDestroy();
} else if (this.mIsStateSaved) {
this.mIsStateSaved = false;
} else {
boolean anyParentIsRemoving = false;
for(Fragment parent = this.getParentFragment(); !anyParentIsRemoving && parent != null; parent = parent.getParentFragment()) {
anyParentIsRemoving = parent.isRemoving();
}
if (this.isRemoving() || anyParentIsRemoving) {
this.getMvpDelegate().onDestroy();
}
}
}
mapView.onDestroy()
super.onDestroy()
mapView?.onDestroy()
P▽
override fun onResume() {
super.onResume()
if (isGoogleMapReady) {
mvpDelegate.onAttach()
}
mapView?.onResume()
}
override fun onStart() {
super.onStart()
if (isGoogleMapReady) {
mvpDelegate.onAttach()
}
}
public void onResume() {
super.onResume();
this.mIsStateSaved = false;
this.getMvpDelegate().onAttach();
}
public void onStart() {
super.onStart();
this.mIsStateSaved = false;
this.getMvpDelegate().onAttach();
}
KD
P▽
YS
P▽
YS
YS
YS
P▽
P▽
P▽
P▽
if (activity?.isFinishing!!) {
mvpDelegate.onDestroy()
return
}
YS
P▽
YS
P▽