Search code examples
androidbroadcastreceiver

Registered BroadCast Receiver in Android


Is there a way to "Scan" All Apps for registered BroadCastReceiver for a specific Action & get the class Name, for example Action Screen On/Off(if root is needed no problems) ?

Thanks


Solution

  • Create the desired Intent. Use PackageManager and queryBroadcastReceivers() to find out who all responds to that Intent, at least for manifest-registered receivers. I do not know if PackageManager returns receivers registered via registerReceiver(), and since that's the only type of receiver that works with ACTION_SCREEN_OFF and ACTION_SCREEN_ON, you might not be able to get data for those specific actions.