android - 在 AlarmManager 中获取 Activity 的 PendingIntents 列表

标签 android android-pendingintent

我有办法获取设备中 Activity PendingIntent 的列表吗?

我开始使用 AlarmManager,我想看看我的 PendingIntent 是否被正确创建和删除。

如果有什么其他的 PendingIntent 也很高兴,只是想看看某个应用是否在做一些“额外的工作”。

最佳答案

adb shell dumpsys alarm > dump.txt

转储.txt:

Current Alarm Manager state:

  Realtime wakeup (now=1309361618777):
  RTC_WAKEUP #5: Alarm{4822f618 type 0 com.google.android.gsf}
    type=0 when=1309882326582 repeatInterval=522747000 count=0
    operation=PendingIntent{47dd3740: PendingIntentRecord{4822aeb8 com.google.android.gsf broadcastIntent}}
  ...
  RTC #5: Alarm{4810f9d8 type 1 com.tmobile.selfhelp}
    type=1 when=1309445979715 repeatInterval=86400000 count=1
    operation=PendingIntent{4815a5c8: PendingIntentRecord{4810f960 com.tmobile.selfhelp startService}}
  RTC #4: Alarm{4810f668 type 1 com.tmobile.selfhelp}
    type=1 when=1309445959620 repeatInterval=86400000 count=1
    operation=PendingIntent{480996e8: PendingIntentRecord{480214a0 com.tmobile.selfhelp broadcastIntent}}
  ...

  Elapsed realtime wakeup (now=2110632):
  ELAPSED_WAKEUP #5: Alarm{481c24e0 type 2 com.google.android.apps.maps}
    type=2 when=2147485512925 repeatInterval=0 count=0
    operation=PendingIntent{47d1d3a8: PendingIntentRecord{481a2600 com.google.android.apps.maps broadcastIntent}}     
  ...
  ELAPSED #1: Alarm{4829ce98 type 3 android}
    type=3 when=2512653 repeatInterval=0 count=0
    operation=PendingIntent{47eabda8: PendingIntentRecord{47f20250 android broadcastIntent}}
  ELAPSED #0: Alarm{480f0198 type 3 com.mixzing.basic}
    type=3 when=2439998 repeatInterval=0 count=0
    operation=PendingIntent{48100dd8: PendingIntentRecord{480ff5a0 com.mixzing.basic broadcastIntent}}

  Broadcast ref count: 0

  Alarm Stats:
  com.google.android.location
    3ms running, 1 wakeups
    1 alarms: act=com.google.android.location.ALARM_WAKEUP flg=0x4
  com.google.android.gsf
    274ms running, 4 wakeups
    1 alarms: flg=0x4
    1 alarms: act=com.google.android.intent.action.GTALK_RECONNECT flg=0x4
    2 alarms: act=com.google.android.intent.action.GTALK_HEARTBEAT flg=0x4
 ...
-------------------------------------------------------------------------------

关于android - 在 AlarmManager 中获取 Activity 的 PendingIntents 列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6522792/

相关文章:

安卓工作室 SDK

java - 用于更新通知 channel 设置的 Android 通知操作

android - 从 PendingIntent 获取 Intent 导致 SecurityException

android - 如何更新自定义布局通知操作?

java - Android 布局不一致

android - 我应该如何将通知 channel 分配给现有的 Firebase 通知类?

java - 启动和停止来自广播接收器的通知

Android通知,当有多个通知时只加载最新的 Intent

android - 在 Android 中,我如何找出在运行时处理 Intent 的类(logcat 很好)

java - Recyclerview 无尽的滚动重新加载页面 onscroll