/**
* 定时任务
*/
final Handler handler = new Handler();
Runnable runnable = new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
System.out.println(FoodTools.food_today_now_date_time());
handler.postDelayed(this, 1000);
}
};
handler.postDelayed(runnable, 50);// 打开定时器,执行操作
// handler.removeCallbacks(this);// 关闭定时器处理
* 定时任务
*/
final Handler handler = new Handler();
Runnable runnable = new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
System.out.println(FoodTools.food_today_now_date_time());
handler.postDelayed(this, 1000);
}
};
handler.postDelayed(runnable, 50);// 打开定时器,执行操作
// handler.removeCallbacks(this);// 关闭定时器处理