Reputation: 841
I have a BroadcastReceiver that i'm trying to detect when the system boot is completed but the Receiver doesn't get fired, or nothing in LogCat, any idea?
AndroidManifest
<!-- SIM Card Receiver -->
<receiver android:name=".SIMChangeNotifierActivity" android:enabled="true" android:exported="false">
<intent-filter android:priority="1001">
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
BroadcastReceiver
public class SIMChangeNotifierActivity extends BroadcastReceiver {
public void onReceive(Context context, Intent intent)
{
if("android.intent.action.BOOT_COMPLETED".equals(intent.getAction()))
{
Log.e("TAG", "Boot completed");
}
}
Upvotes: 1
Views: 7783
Reputation: 1194
Just declare in your manifest
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
Upvotes: 11