简体   繁体   English

如何在Android Studio 3.1.1中带来默认的PDF Opener选项

[英]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.

相关问题 Android Studio版本3.1.1 - android studio version 3.1.1 SQLite 文件打开器 Android Studio - SQLite file opener Android Studio 如何使用Java查找默认文件打开器? - How to Find Out Default File Opener with Java? Android Studio v3.1.1 生成 build apk 时如何修复 checkReleaseBuilds false - How to fix checkReleaseBuilds false when generate build apk in Android Studio v3.1.1 如何在Android Studio中将小部件置于其他提升的小部件的前面 - How to bring a widget in-front of the other elevated widget in android studio HttpRequestException:无法在Android Studio 3.1.1中发出警告(但同步成功) - HttpRequestException: Could Not Head warning in Android Studio 3.1.1 (But Sync Successfully) 如何在android studio中将Html页面转换为Pdf - How to convert Html page to Pdf in android studio 如何将 PAHO/Eclipse MQTT Android 服务带入 Android Studio 项目 - How can I bring the PAHO/Eclipse MQTT Android Service into an Android Studio Project Android菜单未显示在Android Studio的“工具”菜单下。 如何提出? - Android Menu Doesn't Appear Under Android Studio's “Tools” Menu. How to bring it up? 如何更改 android studio 中启动模块的默认值? - How change default on launch module in android studio?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM