Search code examples
androidandroid-activity

How to know which activity is intended to be started in Application class?


My application has two main activities, and they are represented by two icons on the screen. When I tap one of them, an activity is triggered.

I want to run different logic for different activities, but I can't modify the activity class. Any idea how to know which activity is intended to be triggered in Application class?


Solution

  • The Application class does not trigger any Activity (whatever that means...)

    If you want to know which Activity is started when an app icon is clicked, it's determined by which activity has the launcher category defined in your app's AndroidManifest.xml file. See intents-filters and intro to activities.

    Why can't you modify your activity classes?