Android : Android java run activity in background

on Monday, April 13, 2015


I am creating a notification and I add "addAction" to my notification. I want to when I click on the "addAction", the notification remove and run another one code. How I can do this?



Intent intent = new Intent(context, Activity.class);
PendingIntent pi = PendingIntent.getActivity(context, 0, intent,PendingIntent.FLAG_UPDATE_CURRENT);
.........
.addAction(R.drawable.eye, "View", pi)


I want to run Activity.class in background, I mean to that this activity doenst open but the code in this activity run. How I can do this?


0 comments:

Post a Comment