I want to putExtra() my object into an intent then send it to a resident service and let it process the object further.
I’ve imlemented the parcelable etc. and I’ve done the putExtra() code. Now I ran into a problem:I don’t know how to use the getExtra() smart-ly.
Most of the examples on this site are about activity to activity communication – that is, the moment you pass your object or parcelable to another activity is the same moment you launch your target activity, which means all you have to do is to put your getExtra() in the onCreate method and you will be all set.
But as I mentioned I wanted a resident service, which means that this service will be created and started perhaps long before my sending a parcelable object.
Of course I can implement a runnable with delay timer which check the intent passed to it on a regular interval but that would be too much of a hassle. Moreover I simply refuse to believe that the android API doesn’t have a way to detect a putExtra() even. I mean it seems quite unlikely.
So what should I do to get my getExtra() in my data processing service called every time a putExtra() method was called? I mean java is an OOPL, it is event driven, right? There must be something I can exploit?