【发布时间】:2018-07-23 06:53:10
【问题描述】:
我制作了一个将图像转换为 pdf 的应用程序,该应用程序通过设备中的 pdf 打开器打开 pdf。我面临的问题是,如果设备中存在多个 pdf 打开器,则不会显示“记住我”选项。
是否有任何以编程方式可以启用的方法?
【问题讨论】:
我制作了一个将图像转换为 pdf 的应用程序,该应用程序通过设备中的 pdf 打开器打开 pdf。我面临的问题是,如果设备中存在多个 pdf 打开器,则不会显示“记住我”选项。
是否有任何以编程方式可以启用的方法?
【问题讨论】:
// 像下面这样从设备更改默认的 pdf 阅读器->
Try clearing the defaults for the Google PDF Viewer app. You can do this on Android 4.x - 5.x by doing the following:
Go to Settings -> Apps -> All.
Scroll down to Google PDF Viewer app and tap on it.
Scroll down to the Launch by default section and tap the "Clear Defaults" button.
Next time you try to open a PDF, a pop-up should present you with options of all the installed apps that handle PDF viewing.
//用于打开android文件
Intent intent = new Intent(Intent.ACTION_VIEW);
File file = new File( filename );
intent.setDataAndType( Uri.fromFile( file ), "application/pdf" );
startActivity(intent);
【讨论】: