File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 2828import android .os .Bundle ;
2929import android .os .Handler ;
3030import android .os .Message ;
31+ import android .util .Log ;
3132import android .util .TypedValue ;
3233import android .view .ActionMode ;
3334import android .view .ContextMenu ;
7778 */
7879public class Dialog implements DialogInterface , Window .Callback ,
7980 KeyEvent .Callback , OnCreateContextMenuListener {
81+ private static final String TAG = "Dialog" ;
8082 private Activity mOwnerActivity ;
8183
8284 final Context mContext ;
@@ -300,15 +302,21 @@ public void dismiss() {
300302 if (Thread .currentThread () != mUiThread ) {
301303 mHandler .post (mDismissAction );
302304 } else {
305+ mHandler .removeCallbacks (mDismissAction );
303306 mDismissAction .run ();
304307 }
305308 }
306309
307- private void dismissDialog () {
310+ void dismissDialog () {
308311 if (mDecor == null || !mShowing ) {
309312 return ;
310313 }
311314
315+ if (mWindow .isDestroyed ()) {
316+ Log .e (TAG , "Tried to dismissDialog() but the Dialog's window was already destroyed!" );
317+ return ;
318+ }
319+
312320 try {
313321 mWindowManager .removeView (mDecor );
314322 } finally {
You can’t perform that action at this time.
0 commit comments