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

The following examples show how to use android.support.v4.app.DialogFragment#dismiss() . 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: ErrorDialogManager.java    From KUtils with Apache License 2.0 6 votes vote down vote up
public void onEventMainThread(ThrowableFailureEvent event) {
    if (!isInExecutionScope(executionScope, event)) {
        return;
    }
    checkLogException(event);
    // Execute pending commits before finding to avoid multiple error fragments being shown
    FragmentManager fm = getFragmentManager();
    fm.executePendingTransactions();

    DialogFragment existingFragment = (DialogFragment) fm.findFragmentByTag(TAG_ERROR_DIALOG);
    if (existingFragment != null) {
        // Just show the latest error
        existingFragment.dismiss();
    }

    DialogFragment errorFragment = (DialogFragment) factory
            .prepareErrorFragment(event, finishAfterDialog, argumentsForErrorDialog);
    if (errorFragment != null) {
        errorFragment.show(fm, TAG_ERROR_DIALOG);
    }
}
 
Example 2
Source File: ErrorDialogManager.java    From KUtils-master with Apache License 2.0 6 votes vote down vote up
public void onEventMainThread(ThrowableFailureEvent event) {
    if (!isInExecutionScope(executionScope, event)) {
        return;
    }
    checkLogException(event);
    // Execute pending commits before finding to avoid multiple error fragments being shown
    FragmentManager fm = getFragmentManager();
    fm.executePendingTransactions();

    DialogFragment existingFragment = (DialogFragment) fm.findFragmentByTag(TAG_ERROR_DIALOG);
    if (existingFragment != null) {
        // Just show the latest error
        existingFragment.dismiss();
    }

    DialogFragment errorFragment = (DialogFragment) factory
            .prepareErrorFragment(event, finishAfterDialog, argumentsForErrorDialog);
    if (errorFragment != null) {
        errorFragment.show(fm, TAG_ERROR_DIALOG);
    }
}
 
Example 3
Source File: IgnoreTextDialogActivity.java    From oversec with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onPause() {
    super.onPause();

    DialogFragment dialog = (DialogFragment) getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG);
    if (dialog != null) {
        dialog.dismiss();
    }
}
 
Example 4
Source File: FullScannerFragment.java    From alpha-wallet-android with MIT License 5 votes vote down vote up
public void closeDialog(String dialogName) {
    FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
    DialogFragment fragment = (DialogFragment) fragmentManager.findFragmentByTag(dialogName);
    if(fragment != null) {
        fragment.dismiss();
    }
}
 
Example 5
Source File: MainActivity.java    From OpenCircle with GNU General Public License v3.0 5 votes vote down vote up
public void dismissGettingLocationAlert()
{
    DialogFragment dialogFragment = (DialogFragment) getSupportFragmentManager()
            .findFragmentByTag(ConstantsDialog.PROGRESS_LOCATION_DIALOG);
    if(dialogFragment != null)
    {
        Log.d(LOG_TAG, "dismissGettingLocationAlert");
        dialogFragment.dismiss();
    }
}
 
Example 6
Source File: AuthenticatorActivity.java    From Cirrus_depricated with GNU General Public License v2.0 5 votes vote down vote up
private void dismissDialog(String dialogTag){
    Fragment frag = getSupportFragmentManager().findFragmentByTag(dialogTag);
    if (frag != null && frag instanceof DialogFragment) {
        DialogFragment dialog = (DialogFragment) frag;
        dialog.dismiss();
    }
}
 
Example 7
Source File: ZulipActivity.java    From zulip-android with Apache License 2.0 5 votes vote down vote up
/**
 * The dialog fragment receives a reference to this Activity through the
 * Fragment.onAttach() callback, which it uses to call the following methods
 * defined by the ListDialogFragment.ListDialogListener interface.
 */
@Override
public void onDialogPhotoClick(DialogFragment dialog) {
    // User touched the dialog's "Take picture" button
    dialog.dismiss();
    dispatchTakePictureIntent();
}
 
Example 8
Source File: CreateEditActivity.java    From recurrence with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onIconSelection(DialogFragment dialog, String iconName, String iconType, int iconResId) {
    icon = iconName;
    iconText.setText(iconType);
    imageIconSelect.setImageResource(iconResId);
    dialog.dismiss();
}
 
Example 9
Source File: PermissionRequestFragment.java    From android-PermissionRequest with Apache License 2.0 5 votes vote down vote up
@Override
public void onPermissionRequestCanceled(PermissionRequest request) {
    Log.i(TAG, "onPermissionRequestCanceled");
    // We dismiss the prompt UI here as the request is no longer valid.
    mPermissionRequest = null;
    DialogFragment fragment = (DialogFragment) getChildFragmentManager()
            .findFragmentByTag(FRAGMENT_DIALOG);
    if (null != fragment) {
        fragment.dismiss();
    }
}
 
Example 10
Source File: MainActivity.java    From sana.mobile with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void onDialogNegativeClick(DialogFragment dialog) {
    try {
        dialog.dismiss();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        if (dialog.getId() == R.id.dialog_authentication)
            this.finish();
    }
}
 
Example 11
Source File: ZulipActivity.java    From zulip-android with Apache License 2.0 4 votes vote down vote up
@Override
public void onDialogFileClick(DialogFragment dialog) {
    // User touched the dialog's "Pick a file" button
    dialog.dismiss();
    dispatchPickIntent();
}
 
Example 12
Source File: MapFragment.java    From settlers-remake with MIT License 4 votes vote down vote up
private void dismissGameMenu() {
	DialogFragment gameMenuDialog = (DialogFragment) getChildFragmentManager().findFragmentByTag(TAG_GAME_MENU_DIALOG);
	if (gameMenuDialog != null) {
		gameMenuDialog.dismiss();
	}
}