nick allen
nick allen

Reputation: 282

Trying to start a private service

I'm trying to start a service. This service is not meant to be called by other application.

I am trying to call startService with an Intent that was created using Context and Class parameters. I'm trying to use createPackageContext(getPackageName(), CONTEXT_IGNORE_SECURITY) to get the package context. startService however is having no effect, onStartCommand is never being called.

How do I start a service that is within the same package?

Upvotes: 0

Views: 308

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007218

How do I start a service that is within the same package?

startService(new Intent(this, MyServiceClass.class));

Upvotes: 1

Related Questions