dialog: proper finish fix 3

This commit is contained in:
Yuriy Liskov
2025-07-06 03:17:49 +03:00
parent cbc3d492d6
commit 57332b11c9

View File

@@ -98,13 +98,14 @@ public class AppDialogActivity extends MotherActivity {
@Override
public void finish() {
super.finishReally();
// NOTE: Fragment's onDestroy/onDestroyView are not reliable way to catch dialog finish
Log.d(TAG, "Dialog finish");
if (mFragment != null) { // fragment isn't created yet (expandable = true)
mFragment.onFinish();
}
// Destroy dialog when BACK is pressed. NoHistory isn't reliable if combined with singleInstance
finishReally();
}
@Override
@@ -115,5 +116,8 @@ public class AppDialogActivity extends MotherActivity {
if (ViewManager.instance(this).getTopView() == PlaybackView.class && PlaybackPresenter.instance(this).getContext() instanceof PlaybackActivity) {
((PlaybackActivity) PlaybackPresenter.instance(this).getContext()).onUserLeaveHint();
}
// Destroy dialog when Home is pressed. NoHistory isn't reliable if combined with singleInstance
finishReally();
}
}