I may have asked a similar question before but i’m still having issues with my broadcast receiver being started when the phone boots up. So what I need to know is how to do a basic broadcast receiver that sends a status bar notification based on a checkbox preference from a different activity weather it’s checked or not and how i’m suppose to list it in the manifest file?
Share
If the BroadcastReceiver and the Activity are in the same package, then you can:
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);in the receiver to get the global preferences object.getSystemServiceto get the NotificationManager (see http://developer.android.com/reference/android/content/Context.html#getSystemService%28java.lang.String%29 and http://developer.android.com/reference/android/app/NotificationManager.html).