不知道为什么它不起作用。
String url = "http://oknowlee.openrepository.com/oknowledge/bitstream/11283/367366/1/4e94464b-f3c4-41d8-8edc-10ec0ae4f5bb.pdf";
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
最佳答案
您没有将该 URL 添加到打开 Intent
替换
Intent intent = new Intent(Intent.ACTION_VIEW);
与
Intent intent = new Intent(Intent.ACTION_VIEW,uri);
关于java - 未从 Android 中的 URL 打开文件进行预览,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34629487/