Android - What is a PendingIntent ? -
Android - What is a PendingIntent ? -
i new android development , had utilize repeating alarm using alarmmanager
. first had chance utilize pendingintent. after reading through documentation ( http://developer.android.com/reference/android/app/pendingintent.html ), confused pendingintent is.
my questions are:
q1. in way pendingintent
'pending' ? apologies question, i'd have intuitive understanding of pendingintent
means.
q2. documentation says:
a pendingintent reference token maintained scheme describing original info used retrieve it. means that, if owning application's process killed, pendingintent remain usable other processes have been given it. if creating application later re-retrieves same kind of pendingintent (same operation, same intent action, data, categories, , components, , same flags), receive pendingintent representing same token if still valid, , can phone call cancel() remove it.
how does,
reference token maintained scheme describing original data
relate code here ?
pendingintent = pendingintent.getbroadcast(getapplicationcontext(),0,photosintent,0); alarmmanager.setrepeating(alarmmanager.elapsed_realtime,systemclock.elapsedrealtime(), 10000, pendingintent);
q3. not understand follows in documentation:
because of behavior, of import know when 2 intents considered same purposes of retrieving pendingintent. mutual error people create create multiple pendingintent objects intents vary in "extra" contents, expecting different pendingintent each time. not happen. parts of intent used matching same ones defined intent.filterequals. if utilize 2 intent objects equivalent per intent.filterequals, same pendingintent both of them.
what extra contents
? refer request code
& flag
parameters in getbroadcast(context context, int requestcode, intent intent, int flags)
method ?
any help on appreciated. online searches have not given me answers looking for. also, give thanks much time.
q1 - in way "pending"?
the scheme stores values store in pendingintent
, lets (or part of framework) them later on, if component looked them had created new intent spontaneously information.
q2 - how "reference token" relate code here?
the android framework doesn't store pendingintent object create; hashes "identifying information" intent (in case, action, data, type, class, , categories) , uses rest of information. literal pendingintent
object create doesn't saved, info represents does.
q3 - "extra contents"?
the "extras" it's referring here parcelable items store via putextra()
. requestcode , flags values saved , retrieved, when documentation refers "extras" means literal getextras()
bundle intents can utilize carry additional information.
android android-pendingintent
Comments
Post a Comment