How can I create several PendingIntent?
I have several notifications, and when user pressing to the last one, everything is ok, but otherwise clicking on the notification is not responding.
My code is:
Intent notificationIntent = new Intent(context, MainActivity.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK).setAction("ShowDialog");
notificationIntent.putExtra("args", Tools.getInstance().generateBundle(progressId, lastId));
notificationBuilder.setContentIntent(PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT));
I suppose that the reason is FLAG_CANCEL_CURRENT, but all flags of PendingIntent cannot resolve my problem.
From my guess,
You just need to give different unique ID to each pending intent and there shall be no any problem in your application.
Like,
PendingIntent.getActivity(context, uniqID, nIntent, PendingIntent.FLAG_ONE_SHOT);If you are not planning to delete or update the intent then you can use
calendar.getTimeInMillis()as your unique ID.