Skip to content Skip to sidebar Skip to footer

Android- How To Check The Type Of Intent Filters Programmatically?

I'm Creating an android application with two Activities(Activity1 and Activity2) where I need to open the app in two ways . Way 1 : By NFC Card In this way ,I need to open the Ac

Solution 1:

The activity chosen to be opened if the user clicks the icon in the launcher is determined by the LAUNCHER category. So it should work if you define the second activity in the Manifest and move these lines to it, i.e. remove it from Activity1 and add it to Activity2:

<categoryandroid:name="android.intent.category.LAUNCHER" /><actionandroid:name="android.intent.action.MAIN" />

Then whenever the user invokes your application, Activity2 is triggered but Activity1 will still be triggered by the other intents.

References:

Post a Comment for "Android- How To Check The Type Of Intent Filters Programmatically?"