我已经做了几个类似的应用程序,使用相同的外部库来加载图像。他们有
<activity
android:name="com.customGallery.CustomGalleryActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="luminous.ACTION_PICK" />
<action android:name="luminous.ACTION_MULTIPLE_PICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity> 现在,我正在制作一个不同的应用程序,使用相同的图像加载库。
问题是“使用:完成操作"对话框。它为我提供了所有使用该库的应用程序。有没有办法避免这种情况,并将此操作设置为只使用我的新应用程序?
这里是意图呼叫:
public static final String ACTION_PICK = "luminous.ACTION_PICK";
public static final String ACTION_MULTIPLE_PICK = "luminous.ACTION_MULTIPLE_PICK";startActivityForResult(新意图(ACTION_MULTIPLE_PICK),200);
发布于 2015-05-20 08:17:24
最后,我找到了一个解决办法:
Intent i = new Intent(Action.ACTION_MULTIPLE_PICK);
i.setPackage(PACKAGE_NAME);
_MainInstance.startActivityForResult(i, 200);因此,只需为意图设置包名即可。
https://stackoverflow.com/questions/29895070
复制相似问题