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,352
  • 21
  • 80
  • 110
Ragini
  • 705
  • 1
  • 8
  • 22

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);
}