Yes. requestCode has always been there. It is currently not used by the Android platform for anything other than as part of a test for PendingIntent matching . Using requestCode to define various PendingIntent is reliable and supported. the documentation even says this:
- If you really need several different
PendingIntent objects working at the same time (for example, to display two notifications simultaneously), you will need to make sure that they have something else to associate them with different PendingIntents. This can be any of the Intent attributes examined by Intent.filterEquals , or different integer code codes provided by getActivity(Context, int, Intent, int) , getActivities(Context, int, Intent[], int) , getBroadcast(Context, int, Intent, int) or getService(Context, int, Intent, int) .
source share