0

I'm using Android Studio's Webview to convert my web app to mobile app. my webapp has a login which shows your account's files (pdf files). but running my default app on Android Studio, won't open these pdf files.

I read here to use Google viewer and just put the link of your PDF file just like below,

WebView webview=new WebView(this);
        webview.getSettings().setJavaScriptEnabled(true);
        String pdf = "http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf";

        webview.loadUrl("http://docs.google.com/gview?embedded=true&url=" + pdf);

however, the webapp is setup wherein if you open the PDF file, it doesn't have the .pdf extension. Example is: https://mysite/files/myfiles/1234567_00/. As you see, the link does not point to a direct pdf file (.pdf extension), instead it only had "/1234567_00/". When I try to replace the link above with the URL (without .pdf extension), it won't open.

Is there a way I can get this to work? What should I change here?

halfer
  • 19,824
  • 17
  • 99
  • 186
Kim Lo
  • 113
  • 1
  • 9
  • Possible duplicate of [android webview pdf viewing](https://stackoverflow.com/questions/9455425/android-webview-pdf-viewing) – Zain Oct 21 '19 at 03:35
  • @Zain nope that one has a different problem, but thanks for trying. – Kim Lo Oct 22 '19 at 00:49

0 Answers0