我试图发送一个意图,Photoshop快车,它现在接受原始图像。在本例中,我将发送一个佳能CR2文件。无论我如何指定操作、数据或类型,我似乎都无法让PSE弹出作为选项。
PSE清单:
<activity android:configChanges="orientation|screenSize" android:launchMode="singleTask" android:name="com.adobe.psmobile.PSXEditActivity">
<meta-data android:name="android.support.PARENT_ACTIVITY" android:value="com.adobe.psmobile.MainActivity"/>
<intent-filter>
<action android:name="android.intent.action.EDIT"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="image/jpeg"/>
<data android:mimeType="image/png"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.EDIT"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="file"/>
<data android:mimeType="*/*"/>
<data android:host="*"/>
<data android:pathPattern=".*\\.cr2"/>
<data android:pathPattern=".*\\.CR2"/>
...数百种尝试组合中的一种:
// Intent action = new Intent();
Intent action = new Intent(Intent.ACTION_EDIT);
// action.setType("*/*");
action.setData(media.getUri());
action.setFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
action.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
Intent chooser = Intent.createChooser(action, getResources().getString(R.string.edit));
startActivityForResult(chooser, REQUEST_CODE_EDIT);:
file:///storage/sdcard1/_test/canon_1d_miv_03.CR2ES文件资源管理器将发送一个CR2文件到PSE,但在任何情况下,我都不能让它作为一个选项出现在除jpeg之外的任何东西。有谁知道如何格式化PSE将使用的意图吗?
发布于 2015-06-26 13:13:08
信不信由你,这才是答案:
Intent action = new Intent(Intent.ACTION_VIEW);
action.setDataAndType(media.getUri(), "");注意空字符串的类型。唯一产生选项的是"*/*",但显示了数十个应用程序。
我仍然不明白为什么空字符串工作,所以如果有人有解释,请告诉我。
发布于 2015-05-29 19:26:12
您说您要在ES文件资源管理器中打开文件,那么也许它已经为某些文件扩展名设置了默认值?
尝试通过以下方式重新设置它们:

对于不同的扩展,您可能需要多次这样做。
https://stackoverflow.com/questions/30537249
复制相似问题