Open/ Resume activity with an alert on Click on notification

view story

http://stackoverflow.com – I have created a notification and on clicking on the notification, I want to open an alertbox having 2 buttons OK and Cancel. Cancel will dismiss the alert and OK will call a javascript method. For this I have created a transparent activity that opens on notification click. But the problem is that : When my app is in opened (foreground or even in background) - The alert is shown, but javascript method is not invoked on clicking OK. Only Alert is dismissed. When my app is closed - The alert is shown on the home screen of the device, but clicking on OK, does nothing. I mean the alert is not c (HowTos)