如何使用Intent分享视频?

时间:2018-06-28 11:48:13

标签: android video sharing

我正在使用以下代码,但无法正常工作。

       Uri uri1 = Uri.parse(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) +
        mContext.getResources().getString(R.string.penless_image) + "/" + fileName);
        Log.e("LOG", "VIDEO PATH==> " + uri1.getPath());
        Intent videoshare = new Intent(Intent.ACTION_SEND);
        videoshare.setType("video/*");
        //videoshare.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
        videoshare.putExtra(Intent.EXTRA_STREAM, uri1);
        mContext.startActivity(Intent.createChooser(videoshare, "Select"));

0 个答案:

没有答案