Xiou Raxau
Xiou Raxau

Reputation: 83

Declare a service(to be private) in android

Upvotes: 3

Views: 2665

Answers (2)

Android Killer
Android Killer

Reputation: 18499

As commonsware told that is a great answer.Also you can do in menifest also like this :

android:exported="false"

Upvotes: 3

CommonsWare
CommonsWare

Reputation: 1007265

Simply do not include an <intent-filter>. Then your service will only be accessible by components within your application. You would use an explicit Intent to interact with it (e.g., new Intent(this, MyPrivateService.class)).

Upvotes: 6

Related Questions