Shmuel
Shmuel

Reputation: 3916

Android - Boot Receiver Error

So I have a boot receiver that is supposed to call an intent service but the receiver isn't registering at all.

Manifest file -

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<receiver android:name=".ClockReciever">
    <intent-filter >
       <action android:name="android.intent.action.BOOT_COMPLETED"/>
       <action android:name="android.intent.action.QUICKBOOT_POWERON" />
    </intent-filter>
</receiver>

ClockReceiver.java

public class ClockReceiver extends BroadcastReceiver {
    private final String TAG = "ClockReciever";
    @Override
    public void onReceive(Context context, Intent intent) {
       Log.d(TAG,"onRecive");
       context.startService(new Intent(context, RefreshIntentService.class));
    }

}

I think this is correct, but according to my logcat the ClockReciever is never called and the program crashes with a "Unable to instantiate receiver" error.

Any suggestions? Thank you

Upvotes: 0

Views: 431

Answers (1)

Trinimon
Trinimon

Reputation: 13957

Here you have a typo

<receiver android:name=".ClockReciever">

Should be ClockReceiver, i.e. same as your class.

Cheers!

Upvotes: 2

Related Questions