Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lollipop API for controlling the Alarm icon in status bar

This is a Lollipop-specific question, since the API has changed. To find out how to do this on earlier versions, see related question:

  • Controlling the Alarm icon in status bar

I would like to know how to turn on / off the system Alarm icon in the status bar as shown in this image:

enter image description here

Timely Alarm Clock controls this icon on Lollipop as of release 1.3. Prior to that release, the code was using private APIs as detailed in the related question.

The new technique they use works on an unrooted Nexus 5 running v5.0.1.


Update

It looks like there is a lot more the this new API than just changing the icon. The lock screen now also displays the time I have set the alarm for.

like image 288
Richard Le Mesurier Avatar asked Feb 06 '15 14:02

Richard Le Mesurier


People also ask

Why is there an alarm icon on my status bar?

An alarm icon will be displayed on the status bar if you have set up an alarm or reminder in a third-party app. Go to the app's settings screen and check whether alarms, reminders, or similar features have been enabled. If so, disable them and try again.

How do I get rid of the alarm icon on my Iphone status bar?

All replies. Yes you can. Open the Clock app, and switch off the alarms that are activated. If you have Bedtime enabled, then turn that feature off.


1 Answers

AlarmManager has a new api to set this.

AlarmManager.setAlarmClock (AlarmManager.AlarmClockInfo info, PendingIntent operation)

If you do this, the alarm shows on notification bar and LockScreen .

like image 169
nandeesh Avatar answered Oct 24 '22 20:10

nandeesh