我正在尝试使用我的应用程序中的三星Multiwindow-SDK功能打开北极星办公室的PDF。
我有以下代码:
if (file.exists()) {
try{
Uri path2 = Uri.fromFile(file);
Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(path2, "application/pdf");
PackageManager manager = getPackageManager();
i = manager.getLaunchIntentForPackage("com.infraware.PolarisOfficeStdForTablet");
i.putExtras(mMWM.makeMultiWindowAppIntent(SMultiWindowManager.FREE_AND_PINUP_STYLE, new Rect(640, 0, 1280, 752)));
i.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(i);
}
catch (ActivityNotFoundException e) {
}polaris窗口在多窗口模式下打开,但我发送的pdf文件没有打开。
有人能帮助我理解为什么PDF不能打开,以及我如何修改我的代码使其工作吗?
谢谢;
安迪
发布于 2013-06-11 23:15:22
下面的方法最终对我起了作用。回答,以防任何人发现此主题与未来类似的问题。
private void openPdfInPolarisOffice(File myPdfFile) {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Rect rect = new Rect(640, 0, 1280, 752);
Intent e = mMWM.makeMultiWindowAppIntent(SMultiWindowManager.SPLIT_ZONE_B, null);
i.putExtras(e);
i.setDataAndType(Uri.fromFile(myPdfFile), "application/pdf");
startActivity(i);
}https://stackoverflow.com/questions/17022264
复制相似问题