[英]How to bring default pdf opener option in android studio 3.1.1
I have made an app for converting images to pdf, which opens the pdf via the pdf opener present in the device. 我已经制作了一个将图像转换为pdf的应用程序,它可以通过设备中存在的pdf打开器打开pdf。 The problem i am facing is that, if there are multiple pdf opener present in the device, the 'remember me' option is not showing.
我面临的问题是,如果设备中存在多个pdf打开器,则不会显示“记住我”选项。
Is there any method programatically via which i can enable the same? 是否有任何以编程方式可以启用该方法的方法?
// change default pdf reader from device like below this-> //更改设备的默认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.
//For openning android file //用于打开android文件
Intent intent = new Intent(Intent.ACTION_VIEW);
File file = new File( filename );
intent.setDataAndType( Uri.fromFile( file ), "application/pdf" );
startActivity(intent);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.