0

I have two applications, the first one send an implicit intent to view a link and the second one named "MyBrowser" receives it. But when I install both apps on my phone (API level 23), the app chooser only display the Internet (default application for web viewing). If I use the AVD (API level 25), app chooser includes also "MyBrowser". Here is my first application's function:

private void startImplicitActivation() {

    Log.i(TAG, "Entered startImplicitActivation()");

    // Create a base intent for viewing a URL 
    Intent baseIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(URL));

    // Create a chooser intent, for choosing which Activity
    // will carry out the baseIntent
    Intent chooserIntent = Intent.createChooser(baseIntent, CHOOSER_TEXT);

    // Verify the intent will resolve to at least one activity
    if (baseIntent.resolveActivity(getPackageManager()) != null) {

        Log.i(TAG,"Chooser Intent Action:" + chooserIntent.getAction());
        // Start the chooser Activity, using the chooser intent
        startActivity(chooserIntent);

    }

And "MyBrowser" Manifest.xml:

<uses-sdk
    android:minSdkVersion="13"
    android:targetSdkVersion="18" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MyBrowserActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="http" />
        </intent-filter>
    </activity>
</application>

I am newbie in android and can't understand why. Please explain to me. Thank you.

John Le
  • 5
  • 3

0 Answers0