private void showLoadingDialog() { dismisLoadingDialog(); this.loadingDialog = new LoadingDialog((Context) this, 2131100006); this.loadingDialog.show(); this.loadingDialog.setOnCancelListener(new OnCancelListener(this) { final /* synthetic */ ChinaMobileWebPayActivity this$0; { if (HotFix.PREVENT_VERIFY) { System.out.println(VerifyLoad.class); } this.this$0 = this$0; } public void onCancel(DialogInterface dialog) { this.this$0.showFailedDialog(); } }); }
private void receiveMessages(int i) { if (checkState == CheckState.EXIST) { changeState(State.RECEIVEING); slotIndex = i; String address = mainActivity.getSavedValue("REMO_DEVICE_ADDRESS"); remoController.recevieMessages(address); receiveDialog = new ProgressDialog(mainActivity); receiveDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { receiveDialog.cancel(); } }); receiveDialog.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialogInterface) { Log.d(TAG, "onCancel: "); changeState(State.IDLE); remoController.cancelReceiveMessages(); } }); receiveDialog.setMessage(getString(R.string.remo_receive_dialog)); receiveDialog.show(); } }
public MQConfirmDialog(Activity activity, String title, String content, OnDialogCallback onDialogCallback) { super(activity, R.style.MQDialog); getWindow().setLayout(-1, -2); setContentView(R.layout.mq_dialog_confirm); this.mTitleTv = (TextView) findViewById(R.id.tv_comfirm_title); this.mContentTv = (TextView) findViewById(R.id.tv_comfirm_content); findViewById(R.id.tv_confirm_cancel).setOnClickListener(this); findViewById(R.id.tv_confirm_confirm).setOnClickListener(this); setOnCancelListener(new OnCancelListener() { public void onCancel(DialogInterface dialog) { MQConfirmDialog.this.mOnDialogCallback.onClickCancel(); } }); setCanceledOnTouchOutside(true); setCancelable(true); this.mOnDialogCallback = onDialogCallback; this.mTitleTv.setText(title); this.mContentTv.setText(content); }
@Deprecated public static EasyProgressDialog showProgressDialog(Context context, String title, String message, boolean canCancelable, OnCancelListener listener) { if (progressDialog == null) { progressDialog = new EasyProgressDialog(context, message); } else if (progressDialog.getContext() != context) { // maybe existing dialog is running in a destroyed activity cotext // we should recreate one LogUtil.e("dialog", "there is a leaked window here,orign context: " + progressDialog.getContext() + " now: " + context); dismissProgressDialog(); progressDialog = new EasyProgressDialog(context, message); } progressDialog.setCancelable(canCancelable); progressDialog.setOnCancelListener(listener); progressDialog.show(); return progressDialog; }
@Override public void onError(BarcodeScanView scanView, int type) { // mBarcodeScanView.releaseAsync(); if (type == BarcodeScanView.PREPARE_ERROR_TYPE || type == BarcodeScanView.CONFIG_FLASH_LIGHT_ERROR_TYPE) { if (mAlertDialog == null) { mAlertDialog = DialogUtil.createCameraAlertDialog(BarcodeScanActivity.this, R.string.hint_information, R.string.camera_open_problem, R.string.ok); mAlertDialog.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { finish(); } }); } mAlertDialog.show(); } }
public static AlertDialog showAlert(final Context context, final String title, final String msg, final View view, final DialogInterface.OnClickListener lOk, final DialogInterface.OnClickListener lCancel) { if (context instanceof Activity && ((Activity) context).isFinishing()) { return null; } final Builder builder = new AlertDialog.Builder(context); builder.setTitle(title); builder.setMessage(msg); builder.setView(view); builder.setPositiveButton(R.string.app_ok, lOk); builder.setNegativeButton(R.string.app_cancel, lCancel); // builder.setCancelable(true); builder.setOnCancelListener(new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { if (lCancel != null) { lCancel.onClick(dialog, 0); } } }); final AlertDialog alert = builder.create(); alert.show(); return alert; }
/** * 显示可取消的进度对话框 * * @param msg * 消息 */ public void showProgressDialog(final String msg, final boolean cancelable, final OnCancelListener cancelListener, final boolean showProgressBar) { dismissProgressDialog(); mActivity.runOnUiThread(new Runnable() { @Override public void run() { if (mActivity == null || mActivity.isFinishing()) { return; } mAlertDialog = new GenericProgressDialog(mActivity); mAlertDialog.setMessage(msg); ((GenericProgressDialog) mAlertDialog).setProgressVisiable(showProgressBar); mAlertDialog.setCancelable(cancelable); mAlertDialog.setOnCancelListener(cancelListener); mAlertDialog.show(); mAlertDialog.setCanceledOnTouchOutside(false); } }); }
public static AlertDialog createTheDialog(Context context,int titleId,OnCancelListener listener, OnCheckedChangeListener checkedChangeListener, android.widget.CompoundButton.OnCheckedChangeListener checkBoxChangeListener){ LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(R.layout.has_same_file_check, null); AlertDialog dialog = new AlertDialog.Builder(context) .setView(view) .setTitle(titleId) .setOnCancelListener(listener) .create(); RadioGroup rg = (RadioGroup)view.findViewById(R.id.whichOperation); rg.setOnCheckedChangeListener(checkedChangeListener); CheckBox cb = (CheckBox)view.findViewById(R.id.doitasSame); cb.setOnCheckedChangeListener(checkBoxChangeListener); return dialog; }
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { // TODO Auto-generated method stub String message = getArguments().getString("message"); ProgressDialog pd = new ProgressDialog(getActivity()); pd.setIndeterminate(true); pd.setOnCancelListener( new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { //getActivity().finish(); } } ); pd.setMessage(message); //this.setStyle(STYLE_NORMAL, ThemeUtil.getAlertTheme(this.getActivity())); return pd; }
private void reload() { relayout_alert.setVisibility(View.GONE); if (pageIndex == 0) { progressDialog(R.string.loading_label); dialog.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface arg0) { finish(); } }); } videoListViewHandler.getRecordVideoList(date, iCam,pageIndex,isAllCamera); }
/** * * @Title showSheet * @Description TODO(这里用一句话描述这个方法的作用) * @param mContext * 上下文环境 * @param actionSheetConfig * ActionSheet配置项 * @param actionSheetItemSelected * ActionSheet Item选中监听 * @param cancelListener * 取消按钮的监听,无需监听可传null * @return Dialog 返回类型 */ @SuppressLint("NewApi") public void show(final Activity activity, ActionSheetConfig actionSheetConfig, final OnActionSheetItemSelected actionSheetItemSelected, OnCancelListener cancelListener) { switch (actionSheetConfig.actionsheetStyle) { case ACTIONSHEET_IOS: new ActionSheet4IOS().show(activity, actionSheetConfig, actionSheetItemSelected, cancelListener); break; case ACTIONSHEET_WECHAT: new ActionSheet4WeChat().show(activity, actionSheetConfig, actionSheetItemSelected, cancelListener); break; default: new ActionSheet4WeChat().show(activity, actionSheetConfig, actionSheetItemSelected, cancelListener); } }
private void showProgress() { if (loadingDialog == null) { if (splash > 0) { Log.i("SplashActivity Showing splash"); setContentView(splash); } else { Log.i("SplashActivity Showing progress"); loadingDialog = ProgressDialog.show(this, null, "Starting...", true, true); loadingDialog.setCanceledOnTouchOutside(false); loadingDialog.setOnCancelListener(new OnCancelListener() { public void onCancel(DialogInterface dialog) { dialogCancelled = true; finish(); } }); } } }
private void startProgressBar() { if (mDlgProgress == null) { mDlgProgress = ProgressDialog.show(this, "", getResources().getString(R.string.add_tip_todo_activity_progress_message)); mDlgProgress.setCancelable(true); mDlgProgress.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { Log.e(TAG, "User cancelled add tip."); mStateHolder.cancelTasks(); } }); } mDlgProgress.show(); setProgressBarIndeterminateVisibility(true); }
@Override protected Dialog onCreateDialog(int id) { switch (id) { case DIALOG_CHECKIN_RESULT: // When the user cancels the dialog (by hitting the 'back' key), we // finish this activity. We don't listen to onDismiss() for this // action, because a device rotation will fire onDismiss(), and our // dialog would not be re-displayed after the rotation is complete. CheckinResultDialog dlg = new CheckinResultDialog( this, mStateHolder.getCheckinResult(), ((Foursquared)getApplication())); dlg.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { removeDialog(DIALOG_CHECKIN_RESULT); setResult(Activity.RESULT_OK); finish(); } }); return dlg; } return null; }
private void startProgressBar() { if (mDlgProgress == null) { mDlgProgress = ProgressDialog.show(this, "", getResources().getString(R.string.add_tip_todo_activity_progress_message)); mDlgProgress.setCancelable(true); mDlgProgress.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { Log.e(TAG, "User cancelled add todo."); mStateHolder.cancelTasks(); } }); } mDlgProgress.show(); setProgressBarIndeterminateVisibility(true); }
public static void show(Activity activity, String title, boolean isCancelable, OnCancelListener listener) { mProgressDialog = new ProgressDialog(activity); mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); mProgressDialog.setIndeterminate(true); mProgressDialog.getWindow().setGravity(Gravity.CENTER_VERTICAL); mProgressDialog.setCancelable(isCancelable); if (AppUtil.isNotEmpty(title)) { mProgressDialog.setMessage(title); } if (null != listener) { mProgressDialog.setOnCancelListener(listener); } if (mProgressDialog.isShowing()) { mProgressDialog.dismiss(); } mProgressDialog.show(); }
/**手动点击返回键取消弹出窗口,会发送该事件;接着会发送OnDismissListener事件**/ public synchronized static void setOnCancelListener(OnCancelListener l) { if(mOnCancelListener == l) return; final OnCancelListener oldListnener = mOnCancelListener; mOnCancelListener = l; if(oldListnener != null) { final MyDialog dialog = MyDialog.get(); if(dialog != null) { if(mUiThread != Thread.currentThread()) { if(mHandler != null) mHandler.post(new Runnable() { @Override public void run() { oldListnener.onCancel(dialog); } }); }else { oldListnener.onCancel(dialog); } } } }
public static void zza(Activity paramActivity, DialogInterface.OnCancelListener paramOnCancelListener, String paramString, Dialog paramDialog) { if ((paramActivity instanceof FragmentActivity)) { android.support.v4.app.FragmentManager localFragmentManager1 = ((FragmentActivity)paramActivity).getSupportFragmentManager(); SupportErrorDialogFragment.newInstance(paramDialog, paramOnCancelListener).show(localFragmentManager1, paramString); return; } if (zzq.zzdC(11)) { android.app.FragmentManager localFragmentManager = paramActivity.getFragmentManager(); ErrorDialogFragment.newInstance(paramDialog, paramOnCancelListener).show(localFragmentManager, paramString); return; } throw new RuntimeException("This Activity does not support Fragments."); }
public final void onProviderInstallFailed$10b55c15(int paramInt) { sendAnalyticsBackgroundEvent$255f295(paramInt); GoogleApiAvailability.getInstance(); if (GoogleApiAvailability.isUserResolvableError(paramInt)) { GooglePlayServicesUtil.showErrorDialogFragment(paramInt, getActivity(), this, 6000, new DialogInterface.OnCancelListener() { public final void onCancel(DialogInterface paramAnonymousDialogInterface) { AnalyticsUtil.createAndSendClickEvent(RedirectFragment.this, 1636, 1622); RedirectFragment.this.onProviderInstallerNotAvailable(); } }); AnalyticsUtil.createAndSendImpressionEvent(this, 1636); return; } onProviderInstallerNotAvailable(); }
@Override protected void onPreExecute() { super.onPreExecute(); if (context != null) { progressDialog = new ProgressDialog(context); progressDialog.setMessage(context.getResources().getString( R.string.loading_message)); progressDialog.setIndeterminate(false); progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); progressDialog.setCancelable(true); progressDialog.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface arg0) { progressDialog.dismiss(); } }); progressDialog.show(); } }
private void showProgress() { if (state == states.LOAD_START) { state = states.LOAD_PROGRESS; } if (progressDialog == null || !progressDialog.isShowing()) { progressDialog = ProgressDialog.show(this, null, getString(R.string.romanblack_html_loading), true); progressDialog.setCancelable(false); progressDialog.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { handler.sendEmptyMessage(LOADING_ABORTED); } }); } }
private void prepareAndShowProgressDialog() { this.progressDialog = new ProgressDialog(this.context); // progressDialog.setMessage("正在初始化公共数据..."); if (this.loadingString != null) { this.showProgressString(this.loadingString); } this.progressDialog.setCancelable(this.isCancleAble); if (this.isCancleAble) { progressDialog.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { BasicAsyncTask.this.cancel(); } }); } progressDialog.show(); }
public static void showCancelableToast(Context context, String message) { // TextView tv = new TextView(context); // tv.setText(message); // mCancelableDialog = new AlertDialog.Builder(context).setView(tv).setCancelable(true).create(); mCancelableDialog = new AlertDialog.Builder(context).setMessage(message).setCancelable(true).create(); mCancelableDialog.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { if (mTimer != null) { mTimer.cancel(); } } }); mCancelableDialog.show(); if (mTimer != null) { mTimer.start(); } }
@Override protected void onPreExecute() { // TODO Auto-generated method stub // super.onPreExecute(); if (mDialog != null) { mDialog.setTitle("正在解压文件"); mDialog.setMessage(mInput.getName()); mDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); mDialog.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { // TODO Auto-generated method stub cancel(false); } }); mDialog.show(); } }
private void showDialog() { BookDownloadDialog mDialog = new BookDownloadDialog(this,false); mDialog.setMessage("正在下载"); mDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); mDialog.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { // TODO Auto-generated method stub // cancel(true); } }); mDialog.show(); mDialog.setMax(100 * 1024 * 1024); mDialog.setProgress(65 * 1024 * 1024); }
public static void showMessageDialog(String title, String message, Activity activity, final Handler handler) { LayoutInflater inflater = LayoutInflater.from(activity); View view = inflater.inflate(R.layout.prompter_message, null); AlertDialog.Builder builder = new AlertDialog.Builder(activity); TextView titleText = (TextView)view.findViewById(R.id.titleText); titleText.setText(title); TextView messageText = (TextView)view.findViewById(R.id.messageText); messageText.setText(message); builder.setView(view); if(handler != null) { builder.setOnCancelListener(new OnCancelListener() { public void onCancel(final DialogInterface dialog) { handler.sendEmptyMessage(0); } }); } builder.create(); builder.show(); }
public void showWait(OnCancelListener cancelListener) { if (mContext.isFinishing()) { return; } if (dismissWiat()) { mWaitPopup = new CustomDialog(mContext); LayoutInflater inflater = (LayoutInflater) mContext.getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); ViewGroup layout = (ViewGroup) inflater.inflate(R.layout.popup_wait, null); mWaitPopup.setLayout(layout); } if (cancelListener != null) { mWaitPopup.setCancelable(true); mWaitPopup.setOnCancelListener(cancelListener); } else { mWaitPopup.setCancelable(false); mWaitPopup.setOnCancelListener(null); } mWaitPopup.findViewById(R.id.waitpopup_container).setVisibility(View.VISIBLE); mWaitPopup.show(); }
private void showProgress() { if (loadingDialog == null) { if (splash > 0) { Log.i("Showing splash"); setContentView(splash); } else { Log.i("Showing progress"); loadingDialog = ProgressDialog.show(this, null, "Starting...", true, true); loadingDialog.setCanceledOnTouchOutside(false); loadingDialog.setOnCancelListener(new OnCancelListener() { public void onCancel(DialogInterface dialog) { dialogCancelled = true; finish(); } }); } } }
/** * 显示刷新弹出框有背景层 */ public void showLoadDialog() { final AbLoadDialogFragment mDialogFragment = AbDialogUtil .showLoadDialog(this, R.drawable.ic_load, "正在查询,请稍候"); mDialogFragment.setAbDialogOnLoadListener(new AbDialogOnLoadListener() { @Override public void onLoad() { // 下载网络数据 downRss(mDialogFragment); } }); // 取消的监听 mDialogFragment.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { AbToastUtil.showToast(DialogActivity.this, "Load框被取消"); } }); }
/** * 显示加载弹出框无背景层 */ public void showLoadPanel() { final AbLoadDialogFragment mDialogFragment = AbDialogUtil .showLoadPanel(this, R.drawable.ic_load, "正在查询,请稍候"); mDialogFragment.setAbDialogOnLoadListener(new AbDialogOnLoadListener() { @Override public void onLoad() { // 下载网络数据 downRss(mDialogFragment); } }); // 取消的监听 mDialogFragment.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { AbToastUtil.showToast(DialogActivity.this, "Load框被取消"); } }); }
/** * 显示刷新弹出框有背景层 */ public void showRefreshDialog() { // 显示重新刷新的框 final AbRefreshDialogFragment mDialogFragment = AbDialogUtil .showRefreshDialog(this, R.drawable.ic_refresh, "请求出错,请重试"); mDialogFragment.setAbDialogOnLoadListener(new AbDialogOnLoadListener() { @Override public void onLoad() { // 下载网络数据 downRss(mDialogFragment); } }); // 取消的监听 mDialogFragment.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { AbToastUtil.showToast(DialogActivity.this, "refresh框被取消"); } }); }
/** * 显示刷新弹出框无背景层 */ public void showRefreshPanel() { // 显示重新刷新的框 final AbRefreshDialogFragment mDialogFragment = AbDialogUtil .showRefreshPanel(this, R.drawable.ic_refresh, "请求出错,请重试"); mDialogFragment.setAbDialogOnLoadListener(new AbDialogOnLoadListener() { @Override public void onLoad() { // 下载网络数据 downRss(mDialogFragment); } }); mDialogFragment.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { AbToastUtil.showToast(DialogActivity.this, "load框被取消"); } }); }
void call(String target) { if (!Receiver.engine(this).call(target,true)) { new AlertDialog.Builder(this) .setMessage(R.string.notfast) .setTitle(R.string.app_name) .setIcon(R.drawable.icon22) .setCancelable(true) .setOnCancelListener(new OnCancelListener() { public void onCancel(DialogInterface dialog) { finish(); } }) .show(); } else finish(); }