Stan
Stan

Reputation: 8768

How to check if an Android application is started by a user or another application

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

Answers (1)

ashakirov
ashakirov

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

Related Questions