Lets try to explain my question:
I got an application and a service.
The application is started with activity A.
The service sends a broadcast that will let the application start Activity B
Now the user starts activity C.
Now the service wants to start activity B again. But how do I let him know that the activity is still on the stack, or is there an intent flag for this?
How do I avoid that it will launch activity B because its already in the stack?
I think you need to make your activity B
singleInstancethat if it’s already create you don’t want to create again, that is launch mode of the activity can be defined in manifestandroid:launchModethat defines how the activity will be instanciated.in your case use
android:launchMode="singleInstance"