Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在android中停止后台运行多个计时器_Android_Multithreading - Fatal编程技术网

在android中停止后台运行多个计时器

在android中停止后台运行多个计时器,android,multithreading,Android,Multithreading,我在活动的不同时间启动了一些计时器。每个计时器都有自己的到期日。但我想在特定情况发生时停止后台运行的所有计时器 如何停止Android中后台运行的多个计时器?您可以轻松取消计时器。 检查下面的代码 private static Timer abc_Timer; abc_Timer=new Timer(); /*`your logic`*/ abc_Timer.cancel(); //cancel method will cancel your timer //After use of cance

我在活动的不同时间启动了一些计时器。每个计时器都有自己的到期日。但我想在特定情况发生时停止后台运行的所有计时器


如何停止Android中后台运行的多个计时器?

您可以轻松取消计时器。 检查下面的代码

private static Timer abc_Timer;
abc_Timer=new Timer();
/*`your logic`*/
abc_Timer.cancel(); //cancel method will cancel your timer
//After use of cancel method use
abc_timer.purge(); //this method will remove all cancelled timer.

你怎么启动计时器?有他们的参考资料和电话吗?