我有一个检测位置的代码,我只想工作2分钟。 当我启动start()方法的脚本必须工作大约2分钟。 问题在那里,如何运行我的脚本只在特定的时间。 我用这个代码但没有正确运行。 不从定时器挡火()()方法。时间表() public class a implements LocationListener{
private LocationManager locationManager;
停止一个TimerTask我已经实现了在Java中一个TimerTask,我需要在一段时间后停止线程: ....
timer = new Timer(); // At this line a new Thread will be created
TimerTask timerTask = new TimerTask() {
int tweetCounte