Can I get the Intent
from a PendingIntent
?
Here is the scenario:
Intent
(let's call it myIntent
)myInfo
)PendingIntent
(myPendingIntent
) using myIntent
AlarmManager
and myPendingIntent
PendingIntent.getBroadcast
myInfo
from myIntent
which is in myPendingIntent
Is this possible? By looking around Google, I am coming close to the conclusion that this is not possible.
In conclusion, the general and main difference between Intent and PendingIntent is that by using the first, you want to start / launch / execute something NOW, while by using the second entity you want to execute that something in the future.
1- requestCode is used to get the same pending intent later on (for cancelling etc) 2- Yes, they will get override as long as your specify the same Receiver to your Intent that you specify on your PendingIntent.
To perform a broadcast via a pending intent so get a PendingIntent via PendingIntent. getBroadcast(). To perform an activity via an pending intent you receive the activity via PendingIntent. getActivity().
Is this possible?
Nope. PendingIntent
is a write-only interface. You can replace the Intent
, but you cannot read it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With