Search code examples
androidandroid-intentlauncher

Start Android application via launcher and via intent filter


I have application with Welcome activity and main activity. It is possible to have: 1. welcome activity as MAIN and LAUNCHER 2. main activity with intent filter to intercept urls?

In this case will application start with main activity when click url? Or will start welcome?


Solution

  • Yes, it is possible.

    In regards to which activity would launch: It depends on which Activity you register the intent filter on.

    When you register an intent-filter, you associate it with an activity, which basically informs the Android OS that the activity specified can handle the intent. You can choose to register it on your welcome activity or your main activity (or any other activity).

    When the user selects your application from the intent-chooser, it will launch the activity you registered with the filter.