IS THERE ANYWAY TO DETERMINE IF AN INTENT PASSED INTO A BROADCASTRECEIVER'S ONRECEIVE IS THE RESULT OF A STICKY BORADCAST INTENT, OR IF IT WAS JUST SENT?

Mayank Tripathi

Total Post:807

Points:4035
Posted by  Mayank Tripathi
 547  View(s)
Ratings:
Rate this:
  1. Mayank Tripathi

    Post:807

    Points:4035
    Is there anyway to determine if an Intent passed into a BroadcastReceiver's onReceive is the result of a sticky Boradcast Intent, or if it was just sent?

    When you call registerReceiver() for that action -- even with a null BroadcastReceiver -- you get the Intent that was last broadcast for that action. Hence, you can use this to find the state of the battery without necessarily registering for all future state changes in the battery.


Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!