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);
この関数を使用して20秒ごとにWebサービスを呼び出すことができます。しかし、正常に動作せず、毎回そのWebサービスを呼び出さなかった。ハンドラ関数がWebサービスを呼び出さない
20秒後に1回だけ実行する必要があります。 「20秒ごとに」実行するために何をしましたか?完全なコードを投稿してください。 – tahsinRupam
私は新しいSendLiveLatLong()を呼び出したいと思います。 20秒ごとに私のウェブサービスはどれですか。 –
投稿SendLiveLatLongコード – shadygoneinsane