这是我的代码,我想在固定间隔后一次又一次地调用该日志,但有些问题如何存在。
@Override
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
Toast.makeText(this, "Service Started...", Toast.LENGTH_LONG).show();
Log.i(tag, "Service started...");
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
Log.i(tag, "Post Delayed Function");
}
}, 2000);
}