What is pendingIntent in android ? and when we should use it ? , I tried to read about it in android documentation, but unfortunately I didn’t get the answer !
What is pendingIntent in android ? and when we should use it ? ,
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A
PendingIntentis anIntentaction that you want to perform, but at a later time. Think of it a putting anIntenton ice. The reason it’s needed is because anIntentmust be created and launched from a validContextin your application, but there are certain cases where one is not available at the time you want to run the action because you are technically outside the application’s context (the two common examples are launching anActivityfrom aNotificationor aBroadcastReceiver.By creating a
PendingIntentyou want to use to launch, say, anActivitywhile you have theContextto do so (from inside anotherActivityorService) you can pass that object around to something external in order for it to launch part of your application on your behalf.HTH