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). > 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/commonsguy http://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

