If I started DialogFragment from an action, what happens when I close DialogFragment? Is activity in the βResultβ state? Or a call like any regular Java call, so the next line is never executed until the dialog box closes?
Suppose the method to run my fragment
private void launchFragment(){ ConfirmationDialog confirm = new ConfirmationDialog(); confirm.show(getSupportFragmentManager(), "confirm"); doMoreStuff(); }
So my question is twofold:
- When
doMoreStuff() is called? Before or after closing a fragment to return to parental activity? - After I close the fragment to return to the parent activity, does the parent activity perform onResume: so if I have a check for some field changed by the fragment, I can work in onResume based on the state of this field:
As in the following example:
@Override public void onResume() { super.onResume(); if(dialogFragmentChangedThis){ workSomeMore(); } }
The fragment starts with
setStyle(STYLE_NO_FRAME, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
so that it is in full screen mode.
source share