Countdown timer on toast doesn't work anymore after android update

点点圈 提交于 2019-12-11 17:42:19

问题


I updated android to newer version and suddenly the countdown timer hat was set on my toasts is not working anymore, the toast disappear after little time despite what time I put in my countodown timer. What could have happened?

   ClickableSpan clickablespan1 = new ClickableSpan() {

            @Override
            public void onClick(View widget) {
                if (toast != null) {
                    toast.cancel();
                    toast = null;
                }
               toast = Toast.makeText(Poeshitesto.this, "touch to continue", Toast.LENGTH_SHORT);
                       toast.show();


  new CountDownTimer(20000, 1000)
                {

                    public void onTick(long millisUntilFinished) {
                        if (toast != null) {
                            toast.show();}}
                    public void onFinish() { if (toast != null) {
                        toast.show();}}


                }.start();



            }

来源:https://stackoverflow.com/questions/56984819/countdown-timer-on-toast-doesnt-work-anymore-after-android-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!