final int delayTime = 20000;
final Handler handler = new Handler();
Runnable runnable = new Runnable() {
@Override
public void run() {
String Refresh_Location;
Refresh_Location = "http://maps.google.com/maps?q=loc:" + "" + currentLatitude + "," + currentLongitude;
Log.e("Refresh Location", "--->" + Refresh_Location);
new SendLiveLatLong().execute();
handler.postDelayed(this, delayTime);
}
};
handler.postDelayed(runnable, delayTime);
我用这个函数来调用Web服务我的每20秒。但它不会正常工作,并且不会每次都调用该Web服务。处理函数不会调用web服务
它应该在20秒后只执行一次。你做了什么“每20秒”执行一次?发布完整的代码。 – tahsinRupam
我想调用新的SendLiveLatLong()。execute();每20秒后。这是我的web服务。 –
后SendLiveLatLong代码 – shadygoneinsane