shyam
shyam

Reputation: 1306

what is pending intent and use of it a android

Can someone please help me understand "pending intent"? Some examples would really help too.

I have googled for it and found some information, but I am still having trouble understanding it.

NotificationManager notificationManager;
PendingIntent pendingIntent;

Updater() {
  notificationManager = (NotificationManager) UpdaterService.this
      .getSystemService(Context.NOTIFICATION_SERVICE);
  notification = new Notification( android.R.drawable.stat_sys_download,
      "MyTwitter", System.currentTimeMillis());
  pendingIntent = PendingIntent.getActivity(UpdaterService.this, 0,
      new Intent(UpdaterService.this, Timeline.class), 0);
}

Upvotes: 1

Views: 1163

Answers (1)

Joe Simpson
Joe Simpson

Reputation: 2594

A pending intent, is like describing an Intent for later use. It's kind of, in real sense like having a recipe to make that same intent up again.

For the AlarmManager, it means it can just store the PendingIntent somewhere else and just make the Intent when needed. Also it means the Intent can be easily repeated.

(As far as I know anyway, anyone correct me if i'm wrong)

Upvotes: 6

Related Questions