Hi Rakesh,
On 1) Could you maybe elaborate a bit more what broadcast message you are listening to and why you would want to hold some sort of state? If the broadcast message is a
normal broadcast message you cannot depend on which broadcast receiver gets the message first. So invocation 2 could come before invocation 1 (in your example). If you are working with
ordered broadcast messages you can influence the order via the
android:priority attribute on the
<intent-filter> element in your
AndroidManifest.xml file. And if you really want maybe you can put the
state on the
Application object instead? Or use
SharedPreferences
Some examples of both types of broadcast messages:
Do something when the phone rings and
Process outgoing calls
Cheers,
Johan
Johan Pelgrim, The Netherlands
SCJP 1.4, SCWCD 1.4, SCBCD 5.0