Use an action string that is unique to the app shortcut. Note that the action string does not need to be on the <intent-filter>
for the <activity>
in the manifest — the <activity>
does not need an <intent-filter>
at all, AFAIK.
You have to have an android:action
attribute in the <intent>
element for the app shortcut anyway (for inexplicable reasons). So, set that to some string. Then, in your activity, you can use getIntent()
to see the Intent
that was used to create the activity and see if it has this particular action string. If it does, then the activity was created through an app shortcut.