Skip to content Skip to sidebar Skip to footer

Starting Jobintentservice From Pendingintent (notification Button)?

In my app, I have a notification button that fires off a short network request in the background using an IntentService. It does not make sense to show a GUI here, which is why I u

Solution 1:

How could I accomplish this?

Use a BroadcastReceiver and a getBroadcast()PendingIntent, then have the receiver call the JobIntentServiceenqueueWork() method from its onReceive() method. I'll admit that I haven't tried this, but AFAIK it should work.

Post a Comment for "Starting Jobintentservice From Pendingintent (notification Button)?"