In my app I need to request periodic location updates, I check the settings in the Activity and then I request the location in a foreground service with LocationServices.FusedLocationApi. How to pass a LocationRequest object from the activity to the service?
Edit1: the service is started from the activity and bound. But I can't understand how to pass that object.
SOLVED: I think I've solved. I have correctly implemented binding and then I've found this answer: [1]How to send an object from one Android Activity to another using Intents? I was making a noob mistake in getting Parceable in the service, which caused a NullPointer but I've solved it. So the solution I was looking for is: Use Parceable (and implement it properly ;))
Note read this Shoaib comment:
Google recommends not to pass any extra parameters to service using intent, it might not be seen on the service side because multiple components can bind to the service and onBind() won't always be called.