chris
chris

Reputation: 313

Does launchMode in manifest have any effect for service?

<service
            android:name="MyService"
            android:launchMode="singleInstance"/>

Does android:launchMode in manifest have any effect for service or is only for Activities?

Upvotes: 3

Views: 1106

Answers (1)

Dipali Shah
Dipali Shah

Reputation: 3798

Does launchMode in manifest have any effect for service?

No, Service listen to the intent filter. Then having this Service open your Activity where launchMode of activity will decide how to launch the Activity on the screen.


Launchmode is concerned about the way Activity is launched on the screen. And we can set it as property in activity tag

Detail about the Launch mode of Activity

Where as , Service itself is a tag that lack a visual user interface. They're used to implement long-running background operations or a rich communications API that can be called by other applications.

Developer guide for Service

Upvotes: 1

Related Questions