Start service intent conversion post 5.0

Post your questions and help other users.

Moderator: Martin

Post Reply
channel
Posts: 7
Joined: 11 Dec 2014 14:33

Start service intent conversion post 5.0

Post by channel » 17 Nov 2015 13:13

Hi, I used the action "Start service" with a specific intent to close an app
com.acmeandroid.listen.action.EXIT
I used it on a old terminal with android pre 5.0 without problem.
Now, tring on a new one with android 5.x (I tried on a S4 and on a G4) I got an error "Service Intent must be explicit"
I've read on various forums that the API has been changed by google and I sould instead use as action something line "android.intent.action.SEND" with some parameters.
My question, after some hours of trying is: could someone poit me in the right direction to convert the old call into the new API format?

Thanks to all

G.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Start service intent conversion post 5.0

Post by Martin » 18 Nov 2015 19:21

Hi,

If you are still targetting the same app, the same intent might still work. You just have to check Explicit Component and select the package of the target app.

Regards,
Martin

channel
Posts: 7
Joined: 11 Dec 2014 14:33

Re: Start service intent conversion post 5.0

Post by channel » 19 Nov 2015 13:28

Absolutely right!
It works. Thanks a lot

Post Reply