View not attached to window manager, dialog dismiss

后端 未结 5 850
北海茫月
北海茫月 2020-12-29 09:50

So I\'ve activity called GameActivity.java and in this activity I call DialogAnswer.show() which simple shows some picture on screen.



        
5条回答
  •  情深已故
    2020-12-29 10:34

    Use a try statement.

    new CountDownTimer(700, 100) {
            public void onTick(long millisUntilFinished) {
            }
            public void onFinish() {
               try {
                   dialog.dismiss();
                   dialog = null;
              } catch (Exception e) {
                   //TODO: Fill in exception
              }
            }
        }.start();
    

提交回复
热议问题