mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 06:39:54 +01:00
Ensure that mailbox setup can proceed after activity was destroyed
This commit is contained in:
@@ -109,12 +109,18 @@ public class MailboxActivity extends BriarActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onShowDownload() {
|
private void onShowDownload() {
|
||||||
|
boolean needToShow = true;
|
||||||
FragmentManager fm = getSupportFragmentManager();
|
FragmentManager fm = getSupportFragmentManager();
|
||||||
|
// if the fragment is already on the back stack, pop back to it
|
||||||
|
// instead of adding it to the stack again
|
||||||
if (fm.findFragmentByTag(SetupDownloadFragment.TAG) != null) {
|
if (fm.findFragmentByTag(SetupDownloadFragment.TAG) != null) {
|
||||||
// if the fragment is already on the back stack, pop back to it
|
// if the activity was previously destroyed, the fragment is still
|
||||||
// instead of adding it to the stack again
|
// found, but popping back to it won't work, so we need to handle
|
||||||
fm.popBackStackImmediate(SetupDownloadFragment.TAG, 0);
|
// this case and show the fragment again anyway.
|
||||||
} else {
|
needToShow =
|
||||||
|
!fm.popBackStackImmediate(SetupDownloadFragment.TAG, 0);
|
||||||
|
}
|
||||||
|
if (needToShow) {
|
||||||
showFragment(fm, new SetupDownloadFragment(),
|
showFragment(fm, new SetupDownloadFragment(),
|
||||||
SetupDownloadFragment.TAG);
|
SetupDownloadFragment.TAG);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user