你可以触发一个事件时,Android的对话框被驳回?你可以、对话框、事件、Android

由网友(不要拿我跟任何人比,我不是谁的影子,更不是谁的替代品。今日小)分享简介:说我有一个创建一个对话框,在我的Andr​​oid应用程序,像这样:Say I have a created a dialog in my Android app like so:private static ProgressDialog dialog;dialog = ProgressDialog.show(M...

说我有一个创建一个对话框,在我的Andr​​oid应用程序,像这样:

Say I have a created a dialog in my Android app like so:

private static ProgressDialog dialog;
dialog = ProgressDialog.show(MainActivity.this, "", "Downloading Files. Please wait...", true);

现在,是有可能触发事件以下被调用的时候?

Now, is it possible to fire an event when the following is called?

dialog.dismiss();

我要做到这一点,在 dialog.dismiss()不只是叫我的方法的原因; 是因为对话框驳回被称为在一个静态类和下我想要做的事情是加载一个新的活动(不能用在一个静态类意图完成)。

The reason I want to do this and not just call my method after dialog.dismiss(); is because the Dialog dismiss is called within a static class and the next thing I want to do is load a new Activity (which cannot be done using Intents within a static class).

推荐答案

使用的OnDismissListener.

有类中的 setOnDismissListener(...)方法对话框

http://developer.android.com/reference/android/app/Dialog.html#setOnDismissListener%28android.content.DialogInterface.OnDismissListener%29

阅读全文

相关推荐

最新文章