android更新后,吐司上的倒数计时器不再起作用

时间:2019-07-11 08:29:17

标签: android-studio timer toast countdowntimer android-toast

我将android更新到了较新的版本,突然我的吐司面包上设置了倒数计时器帽子不再起作用,尽管我放了倒数计时器多少时间,但吐司面包却在短时间后消失了。会发生什么?

   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();



            }

0 个答案:

没有答案