Skip to content Skip to sidebar Skip to footer

About Android.intent.action.boot_completed

I write a sample to learn BroadcastReceiver..But When I reboot my phone, the app broke down. Here is my source code and manifest.xml: public class MainActivity extends Activity {

Solution 1:

You do not have a class named com.example.boot.BootCompleteReceiver, at least based on the code that you have shown in your answer.

While you have a class named BootCompleteReceiver:

  • It is an inner class of MainActivity, and so BootCompleteReceiver is not named com.example.boot.BootCompleteReceiver

  • It is a regular inner class of MainActivity (no static keyword), and so Android could not create an instance of it anyway, even if you had the right name in the manifest

Either move BootCompleteReceiver to be a regular standalone Java class in its own .java file, or make it be a public static class inside MainActivity. In the latter case, the fully-qualified class name for your manifest entry would be com.example.boot.MainActivity$BootCompleteReceiver.

Post a Comment for "About Android.intent.action.boot_completed"