不开分享activity

Not opening share activity

我想从其他应用程序接收数据。我有 ShareActivity class 并将其添加到 AndroidManifest,但我无法将我的应用程序显示到共享应用程序列表中。请帮忙。

<activity
        android:name=".share.ShareActivity"
        android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
        android:excludeFromRecents="true"
        android:launchMode="singleTask"
        android:noHistory="true"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="stateHidden">
        <intent-filter>
            <action android:name="android.intent.action.SEND" />
            <action android:name="android.intent.action.SEND_MULTIPLE" />

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

            <data android:mimeType="audio/*" />
            <data android:mimeType="image/*" />
            <data android:mimeType="text/plain" />
            <data android:mimeType="video/*" />
            <data
                android:host="www.youtube.com"
                android:mimeType="text/*"
                android:scheme="https" />
        </intent-filter>
    </activity>

===============================编辑============= ========================== 只有我删除了这一行并且它起作用了:

            <data
                android:host="www.youtube.com"
                android:mimeType="text/*"
                android:scheme="https" />

指定您的intent-filter,如下面的代码

试试这个

<activity android:name=".share.ShareActivity"  
    android:name=".share.ShareActivity"
    android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
    android:excludeFromRecents="true"
    android:launchMode="singleTask"
    android:noHistory="true"
    android:screenOrientation="portrait"
    android:windowSoftInputMode="stateHidden">

    <intent-filter>
        <action android:name="android.intent.action.SEND" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="image/*" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.SEND" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="text/plain" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.SEND_MULTIPLE" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="image/*" />
    </intent-filter>
</activity>

获取信息read here