I didn’t get your problem exactly what you want to say, but here is the same thing that I did to download the PDF inside the web browser: Android - downloading the PDF / PDF Viewer , this can help you.
From your comment below, I can suggest you think of one scenario:
1. if(network is available) { // load pdf in google docs. } 2. if(network is not available) { //load pdf in third party application which is already been installed in your phone. } else { //Give Alert message that you cant view pdf this time. or whatever message you want to display. }
Give error message
Paresh mayani
source share