I have a service that may be started three different ways, and I need, from within that service, to determine which of the three possible ways it was started. The first way is from Boot, and I know how to do that:
If StartingIntent.Action = "android.intent.action.BOOT_COMPLETED" then....
The other two ways are from another service or from an activity. Is there a way to determine the name of the Activity or the name of the service that started it?
You can however manually create an intent with a custom action and send it to the service:
B4X:
Dim i As Intent
i.Initialize("FromMainActivity", "")
i.SetComponent("<package name>/.<service name (lower cased)>") 'example "b4a.example/.service1"
StartService(i)