Reputation: 8768
Is there a way for Android to check if an application is started by user or by another application/system? For example, an application provides a service or is registered as a content provider. When it is started, I need to know if it is launched directly by interactive user, or via startService, or by ContentResolver. Is this possible?
Upvotes: 3
Views: 311
Reputation: 12350
You can put some extra data (bundle) into the Intent
which starts your app. Different type of values in your extra data will allow you to figure out which service (or whatever) has started your app.
Upvotes: 2