detect default alarm clock application alarms

后端 未结 5 2041
深忆病人
深忆病人 2021-02-20 18:34

I would like to know if there is a way (probably a system broadcast) to know that the alarm clock default application is now start ringing.

if not - I\'ll be satisfied a

5条回答
  •  我在风中等你
    2021-02-20 19:08

    If I understand you right, you want to check which applications use the Alarm Manager class, If that is the case then you can do it by allowing your application to monitor the log cat, once done you will definitely get to know which applications are using alarm. At-least this should work at boot time. You can create a new thread to running the logcat(without the option -d) in the background. Also make sure that you are adding the required permissions in the Manifest for this to work.

    Screen-shot of boot time:

    enter image description here

    Update: LogCat after setting an Alarm for 9:56pm using the default system clock

    After coming to know of OP's requirements through an update in the original question, I tried to set an alarm for a specific time and checked LogCat for the same time and the result is logged below with time details and events in chronological order:

    enter image description here

    This might be of interest as well

提交回复
热议问题