I’ve been searching for this for a while and keep coming up short. However I have setup notifications before where selecting it launches an activity, now I’m trying to mod that code.
This time I’m looking for a solution to run just a single line of code when the notification is selected. I want it to set a button from invisible to visible. So when my notification is cleared I want the code below to take place, not launch an activity or intent:
butNX.setVisibility(0);
Any input on the matter? thanks in advance.
I wasn’t try this, but i think it will resolve your problem.
1. Set up a Receiver where you need it.
2. Create an Intent and add the extras to it something like this:
intent.putExtra("MODE","VIS");.3. Craete a PendingIntent which will broadcast your intent to your receiver.
PendingIntent pIntent=PendingIntent.getBroadcast(yourContext,yourReqCode,yourIntent,yourFlags);
4.Set notification
So while receiver will receive your broadcast it should to check what to do with this intent by data which you send…