Handler mHandler = new Handler();
Runnable mRunnable = new Runnable() {
@Override
public void run() {
Toast.makeText(MainActivity.this, "gg", Toast.LENGTH_SHORT).show();
mHandler.postDelayed(this, 10000);
}
};
mHandler.post(mRunnable); // 启动计时器
mHandler.removeCallbacks(mRunnable); // 停止计时器
android 定时器
最新推荐文章于 2024-06-13 17:05:12 发布