当前应用程序显示在Intent选择器选项中

时间:2017-08-04 13:21:47

标签: android

我的应用中有一些链接,我使用intentChooser来提取Chrome / FireFox等选项,但当前应用首先显示。有没有办法消除它?

所以,当我点击链接时,它会像这样选择," MyApp。铬。 。互联网"

这是我的代码。

@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);
    }
}

这是清单。

<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>

0 个答案:

没有答案