Android Question Intent for Drive PDF Viewer

Discussion in 'Android Questions' started by tdocs2, Apr 28, 2015.

  1. tdocs2

    tdocs2 Well-Known Member Licensed User


    Thank you in advance for answering my question.

    How do I set up an intent to start the Drive PDF Viewer with a specific file?

    For example, the code below (courtesy of NJDude here) launches the Adobe Reader for a speciific pdf.

    Dim i As Intent

    "file:///" & File.DirDefaultExternal & "/test.pdf")

  2. NJDude

    NJDude Expert Licensed User

    I don't think Google Drive opens the file but Google Docs, try this:
    Private i As Intent

    "file:///" & File.DirDefaultExternal & "/myPDF.pdf")

  3. tdocs2

    tdocs2 Well-Known Member Licensed User

    Thank you, NJ.

    I am very appreciative of your contributions and generosity.

    Your solution works (but I did not expect anything else). As usual, you hit the mark.


    I am a little confused (maybe a lot). First, I do not have Google Docs installed in the tablet in which I tested your solution (I have Sheets and Drive). To double verify, I went to Google Play and found the Google Docs app and is asking me to Install (if I had it installed, it would ask me to Open).

    Using the fantastic app, Phone Info by UncleDroid :),
    Drive (Google Drive)
    Google Docs (I installed it AFTER I ran the code you provided) is
    Google Sheets is
    There is an older? Google PDF Viewer: which has a partial copyright by PDFium.

    The PDF Viewer app that comes from the intent you suggested is not the one from PDFium (although both apps are identical except the menu which shows About in the PDFium version).

    I could not find

    So, is this PDFViewer part of Google Drive? I had found this code in Stack Overflow (java continues to be coffee to me):


    Uri pdfUri = Uri.parse("file://sdcard/sdcard0/test.pdf");             
    Intent shareIntent = ShareCompat.IntentBuilder.from(this)
    "Share PDF doc")
                                             .setStream(pdfUri )

    Best regards.

    Last edited: Apr 28, 2015
  4. NJDude

    NJDude Expert Licensed User

    Yes, you are correct, = Googledrive, I got confused for a second because of the package name. My apologies.
    tdocs2 and lemonisdead like this.
  5. tdocs2

    tdocs2 Well-Known Member Licensed User

    I was not quite correct, just confused.

    Thank you for the clarification.

    Best wishes.

  6. thehe

    thehe Member Licensed User

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice