android - Determine how app instance is created? By clicking launcher icon or from service? -


I have an application that runs the service in the background. I must determine whether the application is made from frequency service or No from my application class

Is this possible? Can I get any information from running the app?

In your service you have intent which is opened on some conditions ( When the user taps on the notification, for example)
You can provide a flag with the service putExtra on the intent. In your activity you read this flag, and if it is set to a specific value that you know it has started with the service.


Comments