Embed Pdf from Google drive with webview

It can be stored anywhere as long as it’s publicly accessible. In my case, I have some PDF’s stored in google drive, some are stored in glide, and some are just pulled directly from other websites.

Wrapping the url, forces Google to retrieve the file from wherever it’s stored, and displays it in it’s document viewer, which embeds nicely in a WebView component.

The only problem I’ve ever had is that sometimes the document won’t load. Just a simple back button and opening the document again takes care of it.