Android如何设置我的应用在WPS中不可以分享给好友,但是可以以文件方式发送
时间: 2024-03-03 14:53:25 浏览: 15
要设置你的应用在WPS中不可以分享给好友,但是可以以文件方式发送,可以在你的应用清单文件(AndroidManifest.xml)中添加一个intent-filter,以过滤WPS分享所使用的意图。具体来说,你可以添加以下intent-filter:
```
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="*/*"/>
<data android:mimeType="application/*"/>
<data android:mimeType="image/*"/>
<data android:mimeType="text/*"/>
<!-- 添加以下行 -->
<data android:scheme="wps"/>
<data android:host="com.kingsoft.moffice.fileprovider"/>
<data android:pathPattern=".*\\.wps"/>
</intent-filter>
```
这样,当WPS分享时,它无法匹配到你的应用,因为你的应用不支持"wps"方案,同时,你的应用可以支持以文件方式发送,因为你的应用可以匹配到WPS所使用的fileProvider。注意,你需要将上述代码中的"com.kingsoft.moffice.fileprovider"替换为你的应用的fileProvider的authorities。