3

I am wondering how is it possible to display stock alarm icon near clock and alarm icon together with hour on locked screen (same as you would use stock alarm).

Jakub Szczygieł
  • 1,203
  • 1
  • 13
  • 26

2 Answers2

4

Try this.

Intent alarmChanged = new Intent("android.intent.action.ALARM_CHANGED");
alarmChanged.putExtra("alarmSet", true/*false if you want to hide it*/);
context.sendBroadcast(alarmChanged);
Aerrow
  • 12,086
  • 10
  • 56
  • 90
2

Use the following

Settings.System.putString(context,
                          Settings.System.NEXT_ALARM_FORMATTED,
                          timeStr);

to put alarm date/time on lock screen.

But, some vendors don't use this setting to display alarm data/time on lock screen, for instance, HTC.

yenliangl
  • 784
  • 4
  • 4