0

I have written following code to open url in browser but this url ends with pdf which I want to open in browser but i'm not getting browser option in file chooser.

startActivity(Intent.createChooser(new Intent(Intent.ACTION_VIEW, Uri.parse(httpUrl),"Choose"));
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Ragini
  • 765
  • 1
  • 11
  • 29

1 Answers1

0

Try the following code to open a pdf file from the site in the browser.

public void button (View view) {
        goToUrl ( "http://site address/director/test.pdf");
    }


    private void goToUrl (String url) {
        Uri uriUrl = Uri.parse(url);
        Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl);
        startActivity(launchBrowser);
}