1
我創建了一個jobschedular服務如何申請jobschedular下面棒棒糖
public class JobSchedularService extends JobService {
//called when instance is created.
@Override
public void onCreate() {
super.onCreate();
Log.e("jobservice","oncreate called");
}
//called when service instance is destroyed.
@Override
public void onDestroy() {
super.onDestroy();
Log.e("jobservice","ondestroy called");
}
@Override
public boolean onStartJob(JobParameters jobParameters) {
Log.e("job start"," called");
return true;
}
@Override
public boolean onStopJob(JobParameters jobParameters) {
Log.e("job stop","called");
return false;
}
}
,並使用jobschedular安排工作調用它。 但它只適用於21以上,那麼API 21下面可以應用什麼?
https://github.com/firebase/firebase-jobdispatcher-android – siva35