I have an Application A with package name pa and an application B with package name pb. B has a foreground service called fserviceB. I want to start this fserviceB from application A. How can I do it?
Asked
Active
Viewed 131 times
0
-
1Have you tried to use [`Context#startForegroundService()`](https://developer.android.com/reference/android/content/Context.html#startForegroundService(android.content.Intent)) from A with B's service component as `Intent`? – zapl Feb 05 '20 at 09:20
-
1StartForegroundService with the proper intent built from the package and service name should work. Please note that the Service must be exported by the other package. Otherwise the service is private and cannot be started from the outside. – Gabe Sechan Feb 05 '20 at 09:40