有没有办法打开一个pdf (存储在驱动器上),以便在Android的Google Drive PDF Viewer中打开。当我在使用ACTION_VIEW时,它显示了open选项,如驱动器和浏览器。有没有办法在默认情况下在驱动器中打开。即使它在默认情况下切换到驾驶模式也没问题。
我的代码:
Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(pdf_link));
startActivity(myIntent);
发布于 2020-04-27 11:15:37
我有答案了。下面的代码默认选择Google Drive。
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(pdf_url));
intent.setPackage("com.google.android.apps.docs");
startActivity(intent);
但这仍然列出了所有的谷歌帐户,并要求一个打开。我们如何继续使用默认的google帐户在驱动器中打开pdf?
https://stackoverflow.com/questions/61446412
复制相似问题