0
有一個應用程序,我正在重構使用服務而不是IntentService來處理活動更新。目前使用requestActivityUpdates來使用收集意圖並將其發送到基於IntentService的類進行處理的方法。使用服務請求活動更新 - 如何處理意圖
ActivityRecognition.ActivityRecognitionApi.requestActivityUpdates(
mGoogleApiClient,
DETECTION_INTERVAL_IN_MILLISECONDS,
getActivityDetectionPendingIntent()
).setResultCallback(this);
和
private PendingIntent getActivityDetectionPendingIntent() {
Intent intent = new Intent(getApplicationContext(), ActivityIntentService.class);
return PendingIntent.getService(getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
}
有沒有辦法直接在我的服務類處理的PendingIntent沒有傳遞給它關到IntentService?
很棒!希望文檔更清楚一點... – MrMagoo
@ T.Barrett現在好了記錄在這裏:-) –