Hi, On Jul 4, 3:38 pm, Mark Murphy <[email protected]> wrote: > On Mon, Jul 4, 2011 at 1:57 AM, kampy <[email protected]> wrote: > > I am using AIDL , in that i am binding a service which sends messages > > to the phone numbers if the sim is changed . i need to start this > > service as soon as the phone switches on . but i am getting a > > exception > > > java.lang.RuntimeException: Unable to start receiver > > com.pssl.thefttracker.StartAppTheftTracker: > > android.content.ReceiverCallNotAllowedException: IntentReceiver > > components are not allowed to bind to services > > > can anyone tell me how to overcome this exception . > > You don't "overcome this exception", as you cannot bind to a service > from a BroadcastReceiver. You rewrite your program to not use binding > and AIDL, as they are not needed here. Set up your service to receive > data via extras in an Intent you use with startService(). Use > startService() in the BroadcastReceiver. When the service is done with > its work, have it shut down (e.g., implement it as an IntentService).
there is no data to be transferred from intents and the service i am using shared preferences for the data which i need to sending data between them. the main purpose i am using the broadcast receiver here is to invoke this service when the phone boot completed. Now as this is theft tracker application i need to make the service not available to the user . > > > tell me how to make a service not available fro the user from the > > running services , i mean user should not stop it from the running > > services > > Fortunately, this is impossible. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > Android Training in London:http://bit.ly/smand1,http://bit.ly/smand2 -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

