I am working on user activity tracking application.
I have used the Activity Recognition API to track the user activity.
I have set the Intent service to be called to get the user activity at specified interval for example every 20 seconds.
Below is my Activity recognition intent service class :
/**
* Called when a new activity detection update is available.
*/
@Override
protected void onHandleIntent(Intent intent) {
// mPId = intent.getStringExtra("PID");
--- When I send some data by put extra along with pending intent here i am not getting the user activity intent data. The User activity intent data is replaced by my data
// If the intent contains an result data
if (ActivityRecognitionResult.hasResult(intent)) {
// Get the update
ActivityRecognitionResult result = ActivityRecognitionResult
.extractResult(intent);
// Log the update
saveActivityRecognitionResult(result);
}
}
The above code working fine If I have not passed any own data.
I want to send some data along with this intent. I set that data along with pending intent. But If I set the data I am received only that data not the user activity intent data.
I don't want to to use the shared preference to store and fetch it inside of intent service wont work out.
Please help me to solve this issue.