---
title: "Android Toast  例子"
author: "chunpeng"
date: "2009-11-11T16:38:59Z"
tags: ["Android", "F#"]
slug: "android-toast"
draft: false
lastmod: "2009-11-11T16:38:59Z"
id: 514716
url: "https://chunpeng.iteye.com/blog/514716"
---

```

```

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