Android Notification Preferences
<p>I am trying to connect my check box preferences with my notification such that when the user clicks on any of the check box preferences, the Notification works as specified. I want the "entering" to work only if the preference "alarm entering" is clicked on. Same for exiting and vibration.</p>

<pre><code>             public void onReceive(Context context, Intent intent) {
    // TODO Auto-generated method stub
    String key = LocationManager.KEY_PROXIMITY_ENTERING;

    Boolean entering = intent.getBooleanExtra(key, false);

    if (entering){
        Log.d(getClass().getSimpleName(), "entering");
    }
    else{
        Log.d(getClass().getSimpleName(), "exiting");
    }

    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
    String alertName = prefs.getString("name_preference", "");
    String alertMessage = prefs.getString("message_preference", "");
    //boolean enteringRegion = prefs.getBoolean("alarm_entering", true);
    //boolean exitRegion = prefs.getBoolean("alarm_exiting", false);
    //boolean vibrate = prefs.getBoolean("vibrate_preference", true);

    NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
    PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, null, 0);

    Notification notification = createNotification();
    notification.setLatestEventInfo(context, alertName, alertMessage, pendingIntent);

    notificationManager.notify(NOTIFICATION_ID, notification);
}

private Notification createNotification(){
    Notification notification = new Notification();

    notification.icon = R.drawable.icon_notification;
    notification.when = System.currentTimeMillis();

    notification.flags |= Notification.FLAG_AUTO_CANCEL;
    notification.flags |= Notification.FLAG_SHOW_LIGHTS;
    notification.defaults |= Notification.DEFAULT_LIGHTS;


    long[] vibrate = new long[] {2000, 2000, 2000, 2000, 2000};
    notification.vibrate = vibrate;

    Uri ringURI = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);
    notification.sound = ringURI;

    notification.ledARGB = Color.BLUE;
    notification.ledOnMS = 1500;
    notification.ledOffMS = 1500;
    notification.flags = notification.flags | Notification.FLAG_SHOW_LIGHTS;

    return notification;
</code></pre>
