Is there a way to distinguish if an app was launched from home screen shortcut or form the launcher app drawer?
I'm trying to track my applications usage on my开发者_JAVA技巧 device.
Is there a way to know if an app was launched from a home screen shortcut or from the launcher?
In the logcat I see there is an ActivityManager log each time an app starts, but I can't tell if there's any difference between shortcut launch and app drawer launch.
Thanks
I don't think you can tell the difference necessarily. If you created the shortcut, you might be able to tuck an extra or something in the Intent
to distinguish the cases, but if the user creates the shortcut on her own, there probably is no difference.
Bear in mind that both shortcuts and "app drawers" are constructs of the same home screen application, and some home screen applications may not have shortcuts or may use something substantially different than an "app drawer".
精彩评论