Download PDF from url and read it

后端 未结 1 1691
猫巷女王i
猫巷女王i 2021-01-16 03:31
public void openDocumentWithInstalledApp(String filename) {
String mimetype = \"\";
url = url+ filename;
if (!url.startsWith(\"http://\") && !url.startsWith(         


        
相关标签:
1条回答
  • 2021-01-16 04:01

    As an alternative you can try opening pdf in google docs. Try below code-

       String pdfurl = "http://www.example.com/yourfile.pdf";
       String googleDocsUrl = "http://docs.google.com/viewer?url="+pdfurl;
       Intent intent = new Intent(Intent.ACTION_VIEW);
       intent.setDataAndType(Uri.parse(googleDocsUrl ), "text/html");
       startActivity(intent);
    
    0 讨论(0)
提交回复
热议问题