Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
337 views
in Technique[技术] by (71.8m points)

android - 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:


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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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 .


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...