vibration and sound won't be played
I have the following code:
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
CharSequence tickerText = "HI!";
long when = System.currentTimeMillis();
Notification notificati开发者_高级运维on = new Notification(R.drawable.droid,
tickerText, when);
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notification.flags |= Notification.DEFAULT_SOUND;
notification.flags |= Notification.DEFAULT_LIGHTS;
notification.flags |= Notification.DEFAULT_VIBRATE;
for some reason - none of the flags really applied except for the auto cancel.
No vibration, no sound, no lights.
What can cause this? I tried in 3.1 & in 2.2.1
Thanks
Try:
notification.defaults |= Notification.DEFAULT_SOUND;
notification.defaults |= Notification.DEFAULT_LIGHTS;
notification.defaults |= Notification.DEFAULT_VIBRATE;
精彩评论