0

I am trying launch my BroadcastReceiver-Class "SimChangeReceiver" after system boot-up. Therefore, this class is listening to a intent.action.BOOT_COMPLETED event.

public class SimChangeReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())){
            ... do something ...

After bootup, logCat comes up with an entry:

06-04 20:09:08.070: V/OtaStartupReceiver(399): onReceive: intent action=android.intent.action.BOOT_COMPLETED  mOtaspMode=-1

However, my "SimChangeReceiver" class is never entered.

An extract of my manifest file:

    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

        <receiver android:name=".simchange.SimChangeReceiver" >
        <intent-filter android:priority="999" >
            <action android:name="android.intent.action.BOOT_COMPLETED" />
        </intent-filter>
    </receiver>

I think I only have this problem since my application runs on an Android 4.0.2 system. But I'm not sure ... Is there a known problem since version 4.x.x? Before I tested it on a 2.x.x version.

Does anyone see something I didn't see?

Tim
  • 35,413
  • 11
  • 95
  • 121
Stef
  • 1
  • 1
    Your app wont receiver boot completed if it is installed on the sd card. – Tarun Jun 04 '12 at 18:34
  • 2
    duplicate of [Broadcast receiver not working in ICS if the app is not started atleast once](http://stackoverflow.com/questions/9952562/broadcast-receiver-not-working-in-ics-if-the-app-is-not-started-atleast-once) and many other questions. – CommonsWare Jun 04 '12 at 18:34
  • @CommonsWare that was an eye opener.. :) – Tarun Jun 04 '12 at 18:41

0 Answers0