I have developed an application which has the functionality of receiving notifications from server.
The problem is, when I click on a notification that I have received, it opens a new instance of my application itself.
This behavior is ok, if my app is not in the foreground, but if it is and I try to open a notification, a new instance of my app is created and thus overlapping the previously opened instance of the app.
I don't want this to happen, so when I click on the notification if my app is in the foreground I have to close that and open a new instance.
How should I override the notification's click event?