Code example for AlertDialog

Methods: dismiss, isShowing, setOnDismissListener

0
        mContext = activity;
    } 
 
    @Override 
    public void onDestroyView() { 
        super.onDestroyView(); 
        if (mDialog != null && mDialog.isShowing()) {
            mDialog.setOnDismissListener(null);
            mDialog.dismiss();
            mDialog = null;
        } 
    } 
 
    public void setContactUri(Uri contactUri) {
        mContactUri = contactUri;
        mActive = true;
        if (isStarted()) { 
            Bundle args = new Bundle();
            args.putParcelable(ARG_CONTACT_URI, mContactUri);
            getLoaderManager().restartLoader(R.id.dialog_delete_contact_loader_id, args, this);
        }