View not attached to window manager, dialog dismiss

后端 未结 5 848
北海茫月
北海茫月 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:32

    DO this way

    new CountDownTimer(700, 100) {
                public void onTick(long millisUntilFinished) {
                }
                public void onFinish() {
                    runOnUiThread(new Runnable() {
    
                        @Override
                        public void run() {
                            dialog.dismiss(); //this is line 36
    
                        }
                    });
                }
            }.start();
    

提交回复
热议问题