代码片段:
Handler handler= new Handler();
handler.postDelayed(networkRunnable,
10000);
/**
* A runnable will be called after the 10 second interval
*/
Runnable networkRunnable= new Runnable() {
@Override
public void run() {
//Not fired if I quit the app before 10 seconds after 1 second.
}
};
设置 Handler post 延迟 10 秒后触发。如果我在 1 到 10 秒之间退出应用程序,则永远不会调用 run 方法。
请帮助我。
提前致谢。