如何以编程方式与其他应用共享文件夹?

时间:2019-01-02 22:55:46

标签: java android

我试图通过单击按钮与Google驱动器或保管箱共享我的sdcard/music文件夹。我已经看到文件浏览器应用程序正在这样做。我怎么做?我有用于与其他应用共享文本的代码。

这是我尝试过的方法,但仅适用于文本

try {
            String applink = getResources().getString(R.string.string);
            Intent shareIntent = new Intent(Intent.ACTION_SEND);
            shareIntent.setType("text/plain");
            shareIntent.putExtra(Intent.EXTRA_TEXT, applink);
            startActivity(Intent.createChooser(shareIntent, "Share..."));
        } catch (android.content.ActivityNotFoundException e1) {
            Toast.makeText(getBaseContext(), "no app found to handle request", Toast.LENGTH_LONG).show();
        }

0 个答案:

没有答案
相关问题