Manifesto Piece

`<receiver android:name=".BootReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"> </action> <category android:name="android.intent.category.HOME"> </category> </intent-filter> </receiver> ` 

The class itself:

  import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.widget.Toast; public class BootReciver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) { Toast.makeText(context, "Тест", Toast.LENGTH_LONG).show(); } } } 

Notification is not called, like Log.d and so on. In other words, not performed. What is the problem?

    1 answer 1

    Probably you forgot

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