Kostadin
Kostadin

Reputation: 2549

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?

Upvotes: 0

Views: 349

Answers (2)

Venky
Venky

Reputation: 11107

Yes you can Launch Activity on Tap of URL , for that you need to specify some extra filter to your Activity like data , schema

Check this Sample for launching application from URI Intent

Upvotes: 0

Gophermofur
Gophermofur

Reputation: 2101

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.

Upvotes: 1

Related Questions