WHAT IS A PENDING INTENT?

0 votes
212 views
Shray singh asked 23-Jan-2018 in Technology by Shray singh

WHAT IS A PENDING INTENT?

1 Answer

1 votes
Ayush Agrawal answered 25-Jan-2018 by Ayush Agrawal
A Pending Intent indicates a move to make later on. It gives you a chance to pass a future Intent to another application and enable that application to execute that Intent as though it had an indistinguishable consent from your application, regardless of whether your application is still around when the Intent is in the long run invoked.It is a token that you provide for a remote application which enables the outside application to utilize your application's authorizations to execute a predefined bit of code.
By giving a PendingIntent to another application, you are allowing it the privilege to play out the operation you have determined as though the other application was yourself (with similar authorizations and personality). All things considered, you ought to be cautious about how you construct the PendingIntent: regularly, for instance, the base Intent you supply will have the part name expressly set to one of your own segments, to guarantee it is at last sent there and no place else.
It is an Intent activity that you need to perform yet at a later time. Consider it a putting an Intent on ice. The reason it's required is on the grounds that an Intent must be made and propelled from a legitimate Context in your application, yet there are sure situations where one isn't accessible at the time you need to run the activity since you are in fact outside the application's specific circumstance (the two normal illustrations are propelling an Activity from a Notification or a BroadcastReceiver.By making a PendingIntent you need to use to dispatch, say, an Activity while you have the Context to do as such (from inside another Activity or Service)
Proceeding from the genuine illustration: suppose I need to wash up however I need to shower AFTER I brush my teeth and have breakfast. So I know I won't shower until any less than 30-40 minutes. Despite everything, I have in my mind that I have to set up my garments, and after that stroll up the stairs back to the washroom, at that point uncover and after that shower. Be that as it may, this won't occur until 30-40 minutes have passed. I now have a PENDING expectation to shower. It is PENDING for 30-40 minutes.