I have a notification displayed. Now I want this to happen:
When I click on the notification, I would like to open a Dialog, where I print only 1 string.
Now, I can’t work it out, what to do here, when I create notification:
...
Intent notificationIntent = new Intent(context, {how to open dialog});
...
Then 1 button, for example “OK”, which will close the dialog.
Please, help me.
Thanks.
I do exactly this in one of my apps. In the notification you need to do something like this:
Inside your main activity use the onResume() method to check for this extra:
This code displays an activity with a dialog style, but there is no reason why it can’t create a dialog inside the if statement though.