Android Toast 例子

阅读更多
 
 
          isRunning = true;
          final Toast mToast = new Toast(getApplicationContext());
          final Timer timer = new Timer();
          timer.schedule(new TimerTask()
          {
            @Override
            public void run()
            {
              Log.i("F", "COUNT==" + count);
              count--;
              if (count < 0)
                timer.cancel();
              mToast.setDuration(Toast.LENGTH_LONG);
              mToast.setView(new MyView(context));

              if (isRunning)
              {
                mToast.show();
              }
            }
          }, 3000, 2000);

 

你可能感兴趣的:(Android,F#)