Hi, it seems the url in the answer no longer works. I get an infinite loop with it now in webView listener. The url posted in comment from QFDev is working.
Show 6 more comments. The perfect way to get the preview without full download. Hamzeh Soboh Hamzeh Soboh 7, 5 5 gold badges 38 38 silver badges 54 54 bronze badges. For me, if I am not currently signed in with a google account, then it takes me to a log in page.
Is there a way to bypass this and just view the pdf? Try using viewerjs. New account, otherwise I'd put this as a comment on the answer above. Jameson Quinn Jameson Quinn 1, 13 13 silver badges 21 21 bronze badges. Guilherme Oliveira Guilherme Oliveira 2, 1 1 gold badge 14 14 silver badges 20 20 bronze badges. You can use this webView. Akash Bisariya Akash Bisariya 2, 1 1 gold badge 26 26 silver badges 40 40 bronze badges.
May be, your answer holds good for some programming technique, and the answer could be just the URL, even I can add it into an anchor tag, which is already mentioned above — Siddaram H. Try this, worked for me. ON ; view. Uwe Keim CoolMind ok thanks I also saw it here, developer. Show 3 more comments.
Piotr Labunski 1, 4 4 gold badges 18 18 silver badges 24 24 bronze badges. Download the acrobat reader. This is for a web browser, not a native android application. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Instantly share code, notes, and snippets. Created Feb 24, Code Revisions 1 Stars 3 Forks 2.
Embed What would you like to do? Embed Embed this gist in your website. Share Copy sharable link for this gist. Learn more about clone URLs. Download ZIP. Android - Example for handling redirect urls and open PDF without download, in webview.
Android - Example for handling redirect urls and open PDF without download in webview. The worst thing, some files were not opening at all.
What does one do in such situations? The solution is easy. You just have to change the default PDF viewer on your phone. Then you have to remove it as your default PDF viewer app.
When you do so, you will be asked again to choose a default app. For that, open any PDF file. Once it launches in the new PDF viewer, tap the Recent apps key on your phone to view all the open apps. Notice the name of the app opening your PDF file. There are two ways to do that. Step 1: Open the Recent apps screen. Then tap and hold the app icon that is launching your PDF files. Tap on the App info option.
Step 2: You will be taken to the App info screen. Hit Advanced followed by Open by default. Step 3: Tap on Clear defaults, if available on your phone. But if the option is missing, tap on Open by default followed by Clear defaults.
Once you clear the defaults for the new PDF reader, you will be asked to set a default app when you open any PDF file. Select the app and tap on Always. So follow the above methods to change the default PDF viewer of your phone and then it will be changed for WhatsApp too. Some phones only show the app icon and not the name in the recent apps screen.
To find the name, tap and hold the app icon in the recent apps screen. The name will be revealed.
0コメント