update, the notification light on the Motorola Droid only blinks when
the screen is blank (http://androidforums.com/motorola-droid/76585-
help-led-notification-light-stopped-working.html). I never really
noticed the change, but I was able to confirm the fact. Once the
screen is lit, the notification light goes off.
On Aug 22, 10:08 pm, Brian Swartzfager <bcswa...@gmail.com> wrote:
> I know others have posted with this general problem, but I've read the
> Android developer page on the topic, as well as several forum and blog
> posts (such ashttp://androidblogger.blogspot.com/2009/09/tutorial-how-to-use-led-wi...),
> and no matter what I do, the LED light will not blink.
>
> I've tried it with DEFAULT_LIGHTS:
>
> String ns = Context.NOTIFICATION_SERVICE;
> NotificationManager mNotificationManager = (NotificationManager)
> getSystemService(ns);
> int icon = R.drawable.icon;
> CharSequence tickerText = "Test 1";
> long when = System.currentTimeMillis();
> ...
> Notification notification = new Notification(icon, tickerText, when);
> notification.defaults |= Notification.DEFAULT_LIGHTS;
> final int HELLO_ID = 1;
> mNotificationManager.notify(HELLO_ID, notification);
>
> ...and with custom lighting settings:
>
> String ns = Context.NOTIFICATION_SERVICE;
> NotificationManager mNotificationManager = (NotificationManager)
> getSystemService(ns);
> int icon = R.drawable.icon;
> CharSequence tickerText = "Test 2";
> long when = System.currentTimeMillis();
> Notification notification = new Notification(icon, tickerText, when);
> ...
> notification.ledARGB = 0xff00ff00;
> notification.ledOnMS = 300;
> notification.ledOffMS = 1000;
> notification.flags |= Notification.FLAG_SHOW_LIGHTS;
> final int HELLO_ID = 1;
> mNotificationManager.notify(HELLO_ID, notification);
>
> ...but nothing happens (no error and no light). I can get the same
> notification to play the default notification sound and to vibrate the
> phone, but the LED simply won't work (and I know the light physically
> works, as I see it flash for email and such).
>
> I thought perhaps it might be a color issue, but I've tried a few
> color values with no luck.
>
> I'm pretty much looking for any sort of suggestions, whether they be
> color values worth trying or any sample code from anyone who's
> successfully done LED notifications on a Motorola Droid running 2.1 or
> higher (I noticed one or two posts referenced some sort of bug with
> LED notifications on the Droid but no details were provided).
>
> I will also mention (in case it's relevant, though I doubt that it is)
> that I am defining a custom layout for my notifications.
>
> Thanks.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
No comments:
Post a Comment