Java Code Examples for android.content.DialogInterface.OnCancelListener

The following are top voted examples for showing how to use android.content.DialogInterface.OnCancelListener. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: letv   File: ChinaMobileWebPayActivity.java   Source Code and License 6 votes vote down vote up
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();
        }
    });
}
 
Example 2
Project: JinsMemeBRIDGE-Android   File: RemoConfigFragment.java   Source Code and License 6 votes vote down vote up
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();
  }
}
 
Example 3
Project: boohee_v5.6   File: MQConfirmDialog.java   Source Code and License 6 votes vote down vote up
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);
}
 
Example 4
Project: decoy   File: DialogMaker.java   Source Code and License 6 votes vote down vote up
@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;
}
 
Example 5
Project: QRCodeScanner   File: BarcodeScanActivity.java   Source Code and License 6 votes vote down vote up
@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();
    }
}
 
Example 6
Project: TripBuyer   File: MMAlert.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 7
Project: MyTravelingDiary   File: DialogMaker.java   Source Code and License 6 votes vote down vote up
@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;
}
 
Example 8
Project: TAG   File: DialogHelper.java   Source Code and License 6 votes vote down vote up
/**
 * 显示可取消的进度对话框
 * 
 * @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);
        }
    });
}
 
Example 9
Project: yun2win-sdk-android   File: ViewEffect.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 10
Project: SmartFace   File: DialogHelper.java   Source Code and License 6 votes vote down vote up
/**
 * 显示可取消的进度对话框
 * 
 * @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);
        }
    });
}
 
Example 11
Project: ircradio   File: FragBusy.java   Source Code and License 6 votes vote down vote up
@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;
	
	
}
 
Example 12
Project: Viewer   File: AtHomeCameraVideolistNaoCan.java   Source Code and License 6 votes vote down vote up
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);
}
 
Example 13
Project: BigApp_Discuz_Android   File: ActionSheet.java   Source Code and License 6 votes vote down vote up
/**
 * 
 * @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);
	}
}
 
Example 14
Project: pokemon-go-xposed-mitm   File: SplashActivity.java   Source Code and License 6 votes vote down vote up
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();
                }
            });
        }
    }
}
 
Example 15
Project: foursquared   File: AddTipActivity.java   Source Code and License 6 votes vote down vote up
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);
}
 
Example 16
Project: foursquared   File: CheckinExecuteActivity.java   Source Code and License 6 votes vote down vote up
@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;
}
 
Example 17
Project: foursquared   File: AddTodoActivity.java   Source Code and License 6 votes vote down vote up
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);
}
 
Example 18
Project: Recruitment   File: ProgressDialogHelper.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 19
Project: Wei.Lib2A   File: Prompt.java   Source Code and License 6 votes vote down vote up
/**手动点击返回键取消弹出窗口,会发送该事件;接着会发送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);
			}
		}
	}
}
 
Example 20
Project: FMTech   File: GooglePlayServicesUtil.java   Source Code and License 6 votes vote down vote up
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.");
}
 
Example 21
Project: FMTech   File: RedirectFragment.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 22
Project: World-Weather   File: AsyncTaskWithProgressBar.java   Source Code and License 6 votes vote down vote up
@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();
    }
}
 
Example 23
Project: wechat-android-sdk   File: MMAlert.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 24
Project: android_module_Web   File: WebPlugin.java   Source Code and License 6 votes vote down vote up
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);
            }
        });
    }
}
 
Example 25
Project: ACCAndroid   File: BasicAsyncTask.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 26
Project: ShoppingMall   File: DialogBuilder.java   Source Code and License 6 votes vote down vote up
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();
	}

}
 
Example 27
Project: CouldBooks   File: ZipExtractorTask.java   Source Code and License 6 votes vote down vote up
@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();
	}
}
 
Example 28
Project: CouldBooks   File: WallActivity.java   Source Code and License 6 votes vote down vote up
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);
}
 
Example 29
Project: virgin-mobile-minutes-checker   File: GsPrompter.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 30
Project: NIM_Android_UIKit   File: DialogMaker.java   Source Code and License 6 votes vote down vote up
@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;
}
 
Example 31
Project: BioStar2Android   File: Popup.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 32
Project: wechatsdk-xamarin   File: MMAlert.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 33
Project: Marvelous-Mobile-Ruby-Development   File: SplashActivity.java   Source Code and License 6 votes vote down vote up
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();
                }
            });
        }
    }
}
 
Example 34
Project: Marvelous-Mobile-Ruby-Development   File: SplashActivity.java   Source Code and License 6 votes vote down vote up
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();
                }
            });
        }
    }
}
 
Example 35
Project: androidsummary   File: DialogActivity.java   Source Code and License 6 votes vote down vote up
/**
 * 显示刷新弹出框有背景层
 */
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框被取消");
		}

	});
}
 
Example 36
Project: androidsummary   File: DialogActivity.java   Source Code and License 6 votes vote down vote up
/**
 * 显示加载弹出框无背景层
 */
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框被取消");
		}

	});
}
 
Example 37
Project: androidsummary   File: DialogActivity.java   Source Code and License 6 votes vote down vote up
/**
 * 显示刷新弹出框有背景层
 */
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框被取消");
		}

	});
}
 
Example 38
Project: androidsummary   File: DialogActivity.java   Source Code and License 6 votes vote down vote up
/**
 * 显示刷新弹出框无背景层
 */
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框被取消");
		}

	});
}
 
Example 39
Project: cInterphone   File: SIPUri.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 40
Project: RubotoTest   File: SplashActivity.java   Source Code and License 6 votes vote down vote up
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();
                }
            });
        }
    }
}
 
Example 41
Project: DaumOAuthSDKAndroidSample   File: LoadingIndicator.java   Source Code and License 6 votes vote down vote up
public void startLoadingIndicator(
        Activity activity,
        String title,
        String message,
        boolean cancelable,
        OnCancelListener listener) {

    _dialog = new ProgressDialog(activity);
    Window theWindow = _dialog.getWindow();
    theWindow.requestFeature(Window.FEATURE_NO_TITLE);
    _dialog.setCancelable(cancelable);
    _dialog.setOnCancelListener(listener);
    if (!TextUtils.isEmpty(title)) {
        _dialog.setTitle(title);
    }
    if (!TextUtils.isEmpty(message)) {
        _dialog.setMessage(message);
    }
    _dialog.show();

}
 
Example 42
Project: ObdCommandsTest   File: RunCommandsTask.java   Source Code and License 6 votes vote down vote up
public void onPreExecute() {
	dialog = new ProgressDialog(activity);
	dialog.setTitle(activity.getString(R.string.testing_data));
	dialog.setMessage(activity.getString(R.string.please_wait));
	dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
	dialog.setCancelable(true);
	dialog.setCanceledOnTouchOutside(true);
	dialog.setIndeterminate(false);
	dialog.setOnCancelListener(new OnCancelListener() {
		public void onCancel(DialogInterface pd) {
			cancel = true;
		}
	});
	cancel = false;
	dialog.setMax(activity.getResources().getInteger(
			R.integer.number_of_commands));
	dialog.show();

	cancel = false;
	dialog.show();
}
 
Example 43
Project: ChangYou   File: ARDetailActivity.java   Source Code and License 6 votes vote down vote up
public wsAsyncTask(Context context){
			progress=new ProgressDialog(context);
			progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);
			progress.setIndeterminate(false);
			progress.setCancelable(true);
//			progress.setCanceledOnTouchOutside(true);   //设置是否可以点击屏幕停止加载,这样容易误操作,所以不用了
			progress.setOnCancelListener(new OnCancelListener() {
				
				@Override
				public void onCancel(DialogInterface dialog) {
					// TODO Auto-generated method stub
					toast.setText("已取消图片加载");
					toast.show();
					wsAsyncTask.this.cancel(true);
				}
			});
			progress.setMessage("图片加载中...");
			progress.show();
			toast=Toast.makeText(context, "按返回键可取消图片加载(如果您的网络状况很差)", Toast.LENGTH_LONG);
		}
 
Example 44
Project: ISBN-Reporter   File: SplashActivity.java   Source Code and License 6 votes vote down vote up
private void showProgress() {
    if (loadingDialog == null) {
        if (splash > 0) {
            Log.i("Showing splash");
            requestWindowFeature(android.view.Window.FEATURE_NO_TITLE);
            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();
                }
            });
        }
    }
}
 
Example 45
Project: Twitter-Helper   File: TwitterLoginDialog.java   Source Code and License 6 votes vote down vote up
public static void showLoginDialog(Context mContext, Uri uri) {
	mDialog = new Dialog(mContext,
			style.Theme_DeviceDefault_Dialog_NoActionBar_MinWidth);
	mDialog.setContentView(getWebView(mContext, uri.toString()));
	mDialog.setCancelable(true);
	mDialog.setCanceledOnTouchOutside(true);
	mDialog.setOnCancelListener(new OnCancelListener() {

		@Override
		public void onCancel(DialogInterface dialog) {
			dialog.dismiss();
			TwitterHelper.twitterLoginListener.onLoginFailed(null);

		}
	});
	mDialog.show();
	CommonMethods.showProgressDialog(mContext,
			Constants.DEFAULT_DIALOG_MESSAGE, false);
}
 
Example 46
Project: DocuTranslator   File: OCRFragment.java   Source Code and License 6 votes vote down vote up
private void showProgressDialog() {
	mProgressDialog = new ProgressDialog(mActivity);
	mProgressDialog.setTitle(R.string.title_running_translator);
	mProgressDialog.setMessage(mActivity.getResources().getString(R.string.notif_running_translator) + " "+mTimeElapsedS + "s");
	mProgressDialog.setCancelable(true);
	mProgressDialog.setIndeterminate(true);
	mProgressDialog.setOnCancelListener(new OnCancelListener() {
		@Override
		public void onCancel(DialogInterface dialog) {
			mTimer.cancel();
			mProgressDialog.dismiss();
			// Request connection to be terminated when the dialog is cancelled.
			mConnection.terminateConnection();
			RunTranslatorTask.this.cancel(true);
		}
	});
	mProgressDialog.show();
}
 
Example 47
Project: DocuTranslator   File: PhotoFragment.java   Source Code and License 6 votes vote down vote up
/**
 * Set up and show the progress dialog
 */
private void showProgressDialog(){
	mProgressDialog = new ProgressDialog(mActivity);
   	mProgressDialog.setTitle(R.string.title_running_ocr);
   	mProgressDialog.setMessage(mActivity.getResources().getString(R.string.notif_running_ocr)+" "+mTimeElapsedS+"s");
   	mProgressDialog.setCancelable(true);
   	mProgressDialog.setIndeterminate(true);
   	mProgressDialog.setOnCancelListener(new OnCancelListener() {
		@Override
		public void onCancel(DialogInterface dialog) {
			mTimer.cancel();
			mProgressDialog.dismiss();
			// Request connection to be terminated when the dialog is cancelled.
			mConnection.terminateConnection();
			RunOCRTask.this.cancel(true);
		}
	});
   	mProgressDialog.show();
}
 
Example 48
Project: wikipoff   File: WikipOff.java   Source Code and License 6 votes vote down vote up
public Database getDatabaseHandler(Context context) {

		ArrayList<String> seldb = ConfigManager.getSelectedDBFilesAsList(context);
		
		if (seldb==null) {
			return null;
		} else {
			boolean new_db = config.getBoolean(s(R.string.config_key_should_update_db), false);
			if ((this.dbHandler == null ) || (new_db)){
				if (this.dbHandler!=null)
					this.dbHandler.close();
				try {
					this.dbHandler = new Database(this,seldb);
				} catch (DatabaseException e) {
					Builder b = e.alertUser(context);
					b.setOnCancelListener(new OnCancelListener() {
						@Override
						public void onCancel(DialogInterface dialog) {}
					});
				}
				config.edit().remove(s(R.string.config_key_should_update_db)).commit();
			}
		}
		
		return this.dbHandler;
	}
 
Example 49
Project: physical-web   File: BluetoothSite.java   Source Code and License 6 votes vote down vote up
/**
 * Connects to the Gatt service of the device to download a web page and displays a progress bar
 * for the title.
 * @param deviceAddress The mac address of the bar
 * @param title The title of the web page being downloaded
 */
public void connect(String deviceAddress, String title) {
  running = true;
  String progressTitle = activity.getString(R.string.page_loading_title) + " " + title;
  progress = new ProgressDialog(activity);
  progress.setCancelable(true);
  progress.setOnCancelListener(new OnCancelListener() {
    @Override
    public void onCancel(DialogInterface dialogInterface) {
      Log.i(TAG, "Dialog box canceled");
      close();
    }
  });
  progress.setTitle(progressTitle);
  progress.setMessage(activity.getString(R.string.page_loading_message));
  progress.show();
  activity.runOnUiThread(new Runnable() {
    @Override
    public void run() {
      mBluetoothGatt = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(deviceAddress)
          .connectGatt(activity, false, BluetoothSite.this);
    }
  });
}
 
Example 50
Project: UK-Weather-repo   File: AsyncTaskWithProgressBar.java   Source Code and License 6 votes vote down vote up
@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();
	}
}
 
Example 51
Project: Lieventure-Android   File: SculptureFragment.java   Source Code and License 6 votes vote down vote up
/**
 * init listeners for services and ui elements
 */
private void initListener() {
    if (mGravitySensor == null) {
        mBtnMeasurment.setEnabled(false);
        return;
    }
    mSensorManager.registerListener(this, mGravitySensor, SensorManager.SENSOR_DELAY_NORMAL);
         
    mProgressDialog.setOnCancelListener(new OnCancelListener() {
        
        @Override
        public void onCancel(DialogInterface dialog) {
            mGPSHandler.stopDelivery();
            Toast.makeText(getActivity(), "GPS suche abgebrochen", Toast.LENGTH_SHORT).show();
        }
    });
    
    mBtnMeasurment.setOnClickListener(new OnClickListener() {
        @Override     
        public void onClick(View v) {
            mGPSHandler.startDelivery(SculptureFragment.this);
            mProgressDialog.show();
        }
    });
}
 
Example 52
Project: vmnetx-android   File: Utils.java   Source Code and License 6 votes vote down vote up
public static void showYesNoPrompt(Context _context, String title, String message, OnClickListener onYesListener, OnClickListener onNoListener, OnCancelListener onCancelListener) {
    AlertDialog.Builder builder = new AlertDialog.Builder(_context);
    builder.setTitle(title);
    builder.setIcon(android.R.drawable.ic_dialog_info);
    builder.setMessage(message);
    builder.setPositiveButton("Yes", onYesListener);
    builder.setNegativeButton("No", onNoListener);
    builder.setOnCancelListener(onCancelListener);
    boolean show = true;
    if ( _context instanceof Activity ) {
        Activity activity = (Activity) _context;
        if (activity.isFinishing()) {
            show = false;
        }
    }
    if (show)
        builder.show();
}
 
Example 53
Project: chessonline   File: LoadFEN.java   Source Code and License 6 votes vote down vote up
@Override
protected Dialog onCreateDialog(int id) {
    switch (id) {
    case PROGRESS_DIALOG:
        progress = new ProgressDialog(this);
        progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
        progress.setTitle(R.string.reading_fen_file);
        progress.setOnCancelListener(new OnCancelListener() {
            @Override
            public void onCancel(DialogInterface dialog) {
                Thread thr = workThread;
                if (thr != null)
                    thr.interrupt();
            }
        });
        return progress;
    default:
        return null;
    }
}
 
Example 54
Project: chessonline   File: LoadScid.java   Source Code and License 6 votes vote down vote up
@Override
protected Dialog onCreateDialog(int id) {
    switch (id) {
    case PROGRESS_DIALOG:
        progress = new ProgressDialog(this);
        progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
        progress.setTitle(R.string.reading_scid_file);
        progress.setOnCancelListener(new OnCancelListener() {
            @Override
            public void onCancel(DialogInterface dialog) {
                Thread thr = workThread;
                if (thr != null)
                    thr.interrupt();
            }
        });
        return progress;
    default:
        return null;
    }
}
 
Example 55
Project: BlitzCalc   File: MainActivity.java   Source Code and License 6 votes vote down vote up
private void setupHelper() {
	int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
	if (result == ConnectionResult.SUCCESS && PreferenceManager.getDefaultSharedPreferences(this).getBoolean("sign_in", true)) {
		ConnectivityManager connec = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
		if (!signingIn && connec != null && (connec.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED) || (connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED)) {
			helper = new GameHelper(this, GameHelper.CLIENT_GAMES);
			helper.setMaxAutoSignInAttempts(0);
			helper.setup(this);
			helper.beginUserInitiatedSignIn();
			signingIn = true;
		}
	} else {
		if (!updating) {
			updating = true;
			GooglePlayServicesUtil.showErrorDialogFragment(result, this, 101, new OnCancelListener() {
				@Override
				public void onCancel(DialogInterface dialog) {
					PreferenceManager.getDefaultSharedPreferences(MainActivity.this).edit().putBoolean("play_services_opt_out", true).putBoolean("sign_in", false).apply();
				}
			});
		} else {
			PreferenceManager.getDefaultSharedPreferences(MainActivity.this).edit().putBoolean("play_services_opt_out", true).putBoolean("sign_in", false).apply();
		}
	}
}
 
Example 56
Project: wmc   File: DownloadList.java   Source Code and License 6 votes vote down vote up
/**
 * Click "Back key" to cancel download media object
 */
private DialogInterface.OnCancelListener getOmaDownloadBackKeyClickHanlder(final DownloadInfo downloadInfo, final int downloadID,  final int showReason) {
    return new DialogInterface.OnCancelListener() {
    	
        @Override
        public void onCancel(DialogInterface dialog) {
            if (showReason == Downloads.Impl.STATUS_NEED_HTTP_AUTH) {
                Log.v(LOG_OMA_DL, "DownloadList:getOmaDownloadClickHandler(): " +
                		"Authencticate Download:user click Cancel" );
                ContentValues values = new ContentValues();
                values.put(Downloads.Impl.COLUMN_STATUS, Downloads.Impl.STATUS_UNKNOWN_ERROR);
                int row = getContentResolver().update( ContentUris.withAppendedId(
                        Downloads.Impl.ALL_DOWNLOADS_CONTENT_URI,
                        downloadID), values, null, null);
            }  
            mCurrentDialog = null;
            showNextDialog();
        }
    };
}
 
Example 57
Project: RubotoFelicaRead   File: SplashActivity.java   Source Code and License 6 votes vote down vote up
private void showProgress() {
    if (loadingDialog == null) {
        if (splash > 0) {
            Log.i("Showing splash");
            requestWindowFeature(android.view.Window.FEATURE_NO_TITLE);
            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();
                }
            });
        }
    }
}
 
Example 58
Project: RubotoTest   File: SplashActivity.java   Source Code and License 6 votes vote down vote up
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();
                }
            });
        }
    }
}
 
Example 59
Project: clearskies-ruboto   File: SplashActivity.java   Source Code and License 6 votes vote down vote up
private void showProgress() {
    if (loadingDialog == null) {
        if (splash > 0) {
            Log.i("Showing splash");
            requestWindowFeature(android.view.Window.FEATURE_NO_TITLE);
            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();
                }
            });
        }
    }
}
 
Example 60
Project: phonty   File: SIPUri.java   Source Code and License 6 votes vote down vote up
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();
}