-
Notifications
You must be signed in to change notification settings - Fork 0
Using a seperate process
Devrath edited this page Apr 16, 2024
·
5 revisions
- We mark the service to be run in a
separate processas below
<service android:name=".service.PlayerService"
android:process=":playerprocess"/>By the below way, a messenger can be passed between the Activity and Service as a binder.
- Return
messengerreference instead ofIBinderreference - A
messengeris just a reference to a handler. - Basically when you create a
messengerwe pass ahandlerduring the creation. - A
messengercan be transformed into abinder. - A
messengercan be created from abinder.
- Create a
Handlerto handle the messages to be sent intoService.