In my application, I have implemented GCM and I want to show an AlertDialog or Open Application's Activity depending upon the state of my Application, i.e. if my application is at Foreground state then upon clicking on Notification I want to display an AlertDialog and if the Application is in Background state then the Notification should launch my Application.
Please let me know is there any way through which I can check the Applications status on clicking Notification.
I want to know that from Notification Area on from the Application
Thanks in Advance