【问题标题】:Removing YourSelf from the ShareActionProvider list从 ShareActionProvider 列表中删除 YourSelf
【发布时间】:2013-03-21 15:54:50
【问题描述】:

我在应用程序中使用ActionBarSherlock 以及 ShareActionProvider。我正在使用共享意图以与ActionBarSherlock example 非常相似的方式共享图像:

Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
shareIntent.setType("image/*");

一切正常,唯一的问题是我的应用程序也接受共享图像内容(“image/*”),因此它显示在应用程序列表中。反正有这个吗?

编辑:

这是我的意图过滤器:

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

【问题讨论】:

  • 你能发布你的意图过滤器吗?
  • @JaredBurrows 我已经发布了。

标签: android android-actionbar actionbarsherlock shareactionprovider


【解决方案1】:

如果我理解你想要做什么,基本上,你想动态启用/禁用你的意图过滤器。

据我所知,您无法直接实现您想要的,但您可以通过PackageManager and setComponentEnabledSetting() 获得相同的禁用活动效果。明显地, 如果您的应用可以禁用“接收者”活动。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多