Your flow does not make a lot of sense to me. If the user opens ActivityA, why would you want to open another instance of ActivityA? I'm not sure what else "send a direct Intent
to ActivityA" would mean. I would think a more conventional pattern would be for ActivityA to cancel the Notification
in all cases, and ask the service for the latest data in all cases.
If that pattern is unsuitable for you, then have your Notification
use a service PendingIntent
. Have your service note that the user clicked on the Notification
, then have the service start ActivityA. This gives the same effect for the user (tap on Notification, get ActivityA), but your service finds out about the tap.
Or, use an Intent
in the activity PendingIntent
that is distinct from the Intent
that ActivityA normally starts with. Have ActivityA tell the service, "yo, I gots me an Intent
, yo" in all cases. If the service raised a Notification
and ActivityA indicates it started with the regular Intent
, then tell ActivityA to do something. If the service raised a Notification
and ActivityA indicates it started with the Notification
's Intent
, do something else.