Android用サービスを開発しています。バックグラウンドで実行し、100秒ごとに関数を実行する必要があります。それはソースコードです(例)Androidで新しいクラスのないシンプルなタイマーを作るには?
package com.example
import ....
public class Servizio extends Service {
public IBinder onBind(Intent intent) {
}
public void onCreate() {
}
public void onDestroy() {
//here put the code that stop the timer cycle
}
public void onStart(Intent intent, int startid) {
//i want to begin here the timercycle that each 100 s call myCycle()
}
public void myCycle() {
//code that i can't move on other class!!!
}
}
どうすればいいですか?今サービスはmyCycle()を1回だけ実行します。なぜなら、私はonStart()を呼び出しているからです。
私の答えを密かにして、私にタイプミスを修正する時間を与えないようなものは何もありません。 – JPM
私はあなたの答えを「密かに」しませんでした。私はすでに私のことを書いていた。とにかくあなたのことは間違っていた。 – dogbane
あなたが私に見える場合は – JPM