Open online pdf file through android intent?

前端 未结 12 1566
醉话见心
醉话见心 2020-12-04 21:53

Currently I have a pdf url, and I would like to simply using the intent to open it, however, it does not work if I put the url in intent

12条回答
  •  醉酒成梦
    2020-12-04 22:33

    you can view PDF in web view like this

    Intent intent = new Intent(Intent.ACTION_VIEW);
    
    intent.setDataAndType(Uri.parse( "http://docs.google.com/viewer?url=" + pdfLink), "text/html");
    
    startActivity(intent);
    

提交回复
热议问题