1

I have a few links in my app and I'm using an intentChooser to pull up options like Chrome/FireFox but the current app is showing first. Is there any way to eliminate it?

So when I click the link it goes like this for options, "MyApp. Chrome. Internet."

Here's my code.

@Override
public void showOnline() {
    Uri webpage = Uri.parse(getString(R.string.secret));
    Intent intent = new Intent(Intent.ACTION_VIEW, webpage);
    Intent chooser = Intent.createChooser(intent, "Select");
    if (intent.resolveActivity(getActivity().getPackageManager()) != null) {
        startActivity(chooser);
    }
}

Here's the manifest.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.nope.notforyou">

<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>

<application
    android:name=".MyApplication"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

    <activity
        android:name=".MainActivity"
        android:screenOrientation="sensorPortrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <!-- Include the host attribute if you want your app to respond
                 only to URLs with your app's domain. -->
            <data android:scheme="http" />
            <category android:name="android.intent.category.DEFAULT" />
            <!-- The BROWSABLE category is required to get links from web pages. -->
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>

    </activity>

    <activity
        android:name=".InfoTab.InfoActivity"
        android:screenOrientation="sensorPortrait" />

    <activity
        android:name=".MenuHolderActivity.MenuHolderActivity"
        android:screenOrientation="sensorPortrait" />
    <activity android:name=".No.TestRecordAudioActivity"
        android:screenOrientation="sensorPortrait"/>

    <service android:name="com.jacapps.no.Alarm.AlarmService" />
    <receiver android:name="com.jacapps.no.Alarm.AlarmReceiver"/>


    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>


    <provider android:authorities="com.facebook.app.FacebookContentProvider666"
        android:name="com.facebook.FacebookContentProvider"
        android:exported="true"/>


</application>

</manifest>
Cœur
  • 37,241
  • 25
  • 195
  • 267
MrBovineJoni
  • 296
  • 1
  • 3
  • 15

0 Answers0