0

I am making an Android iBeacon Application where a notification pop-up message is received with vibration,sound or light and these are controlled by a switch.So my question is how to handle these features for notification with a switch in "on" & "off" state.

For my purpose i have already given permission for vibration in Manifest like this:

uses-permission android:name="android.permission.VIBRATE"

Apart from this i"m using the following codes for my purpose:

notif.defaults |= Notification.DEFAULT_SOUND;
notif.defaults |= Notification.DEFAULT_VIBRATE;
notif.defaults |= Notification.DEFAULT_LIGHT;

Apart from this,i have already researched well and followed look-alike similar questions: How to use notification with sound and vibration? How can I enable vibration and lights using the Android notifications api? Vibrate and Sound defaults on notification and etc but none of these solve my issue. I have even gone through developers doc:http://developer.android.com/guide/topics/ui/notifiers/notifications.html.

Community
  • 1
  • 1
SID --- Choke_de_Code
  • 1,131
  • 1
  • 16
  • 41
  • What exactly is not working? – davidgyoung Jul 17 '15 at 11:04
  • Notification message with vibration handled by a switch(if switch is in "on" state then message with vibration should come or else in "off" state only message comes without vibration) – SID --- Choke_de_Code Jul 17 '15 at 11:10
  • It would be helpful if you show what you have tried by posting your existing code that tries to use a switch to control whether vibration/sound/light is active in the notification, and explaining what doesn't work in what you have. Without this code, it sounds like what you really need help with is how to use a switch -- not how to control these aspects of a notification. – davidgyoung Jul 17 '15 at 13:46

0 Answers0