Broadcast receiver, check a checkbox preference state on bootup then send a notification

后端 未结 2 1006
心在旅途
心在旅途 2021-01-27 08:06

My problem is that when I try to read a checkbox preference state from a different activity on bootup then send a status bar notification. Then when the device boots the I get a

2条回答
  •  攒了一身酷
    2021-01-27 08:42

    According to log ('java.lang.RuntimeException: Unable to instantiate receiver'), system is unable to create instance of your receiver class, because system is unable to find specified class (com.brandon.labs.nsettings.receivers.notifyBootup). I think it is probably problems with name (of receiver class) in your AndroidManifest.xml file, and it is not related to preferences.

    In future, if you will get another exception, i recommend you to read carefully message of exception ;) and stack trace. Usually they contains the half of answer to your question. And for popular mistakes - you can try to type exception text into Google (excluding some specific info such as name of class), and you will find solution very fast.

提交回复
热议问题