Java Code Examples for android.support.v4.app.DialogFragment#dismissAllowingStateLoss()

The following examples show how to use android.support.v4.app.DialogFragment#dismissAllowingStateLoss() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UninstallRetainFragment.java    From aptoide-client with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void onPostExecute(Void v) {
    super.onPostExecute(v);
    if (activity != null) {
        if(rollBackAction == RollBackItem.Action.DOWNGRADING) {
            uninstall(activity, packageName, true);
        } else {
            uninstall(activity, packageName, false);
        }
    }

    if(getFragmentManager()!=null){
        DialogFragment pd = (DialogFragment) getFragmentManager().findFragmentByTag("pleaseWaitDialog");
        if(pd!=null){
            pd.dismissAllowingStateLoss();
        }

        getFragmentManager().beginTransaction().remove(UninstallRetainFragment.this).commitAllowingStateLoss();

    }


}
 
Example 2
Source File: AddStoreDialog.java    From aptoide-client with GNU General Public License v2.0 5 votes vote down vote up
void dismissDialog(){
    setRetainInstance(false);
    DialogFragment pd = (DialogFragment) getFragmentManager().findFragmentByTag("addStoreProgress");
    if(pd!=null)
        pd.dismissAllowingStateLoss();

}
 
Example 3
Source File: LoginActivity.java    From aptoide-client with GNU General Public License v2.0 5 votes vote down vote up
public void setShowProgress(final boolean showProgress) {
    final DialogFragment progress = (DialogFragment) getSupportFragmentManager().findFragmentByTag(TAG_PROGRESS);
    if (progress == null && showProgress) {
        try {
            AptoideDialog.pleaseWaitDialog().show(getSupportFragmentManager(), TAG_PROGRESS);
        // https://code.google.com/p/android/issues/detail?id=23761
        } catch (IllegalStateException ignore) { }
    } else if (progress != null && !showProgress) {
        progress.dismissAllowingStateLoss();
    }
}
 
Example 4
Source File: LatestCommentsFragment.java    From aptoide-client with GNU General Public License v2.0 4 votes vote down vote up
protected void dismissDialog() {
    DialogFragment pd = (DialogFragment) getActivity().getSupportFragmentManager().findFragmentByTag("pleaseWaitDialog");
    if (pd != null) {
        pd.dismissAllowingStateLoss();
    }
}
 
Example 5
Source File: BasePurchaseActivity.java    From aptoide-client with GNU General Public License v2.0 4 votes vote down vote up
protected void dismissAllowingStateLoss(){
    DialogFragment pd = (DialogFragment) getSupportFragmentManager().findFragmentByTag("pleaseWaitDialog");
    if (pd != null) {
        pd.dismissAllowingStateLoss();
    }
}
 
Example 6
Source File: ProgressDialogFragment.java    From q-municate-android with Apache License 2.0 4 votes vote down vote up
public static void hide(FragmentManager fm) {
    DialogFragment fragment = (DialogFragment) fm.findFragmentByTag(TAG);
    if (fragment != null) {
        fragment.dismissAllowingStateLoss();
    }
}