简体   繁体   中英

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. The problem i am facing is that, if there are multiple pdf opener present in the device, the 'remember me' option is not showing.

Is there any method programatically via which i can enable the same?

// change default pdf reader from device like below this->

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

Intent intent = new Intent(Intent.ACTION_VIEW);
File file = new File( filename  );
intent.setDataAndType( Uri.fromFile( file ), "application/pdf" );
startActivity(intent);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM