【发布时间】:2018-08-08 04:11:27
【问题描述】:
在此代码下方,我尝试与视频共享文本,但它仅共享视频,文本不与视频共享。
如果有人能解决我的问题,请帮忙。
String path="android.resource://" + "com.avani.videoviewdemo" + "/" + R.raw.ae_kaash_kahi;
//Intent a = getIntent();
file=new File(path);
str=arrayList.get(position).getVideoName();
Log.e("video_name", ""+arrayList.get(position).getVideoName()); Log.e("video_name",""+ str);
id = context.getResources().getIdentifier(str, "raw", context.getPackageName()); Uri uri = Uri.parse("android.resource://" + context.getPackageName() + "/" + id);
DownloadFile();
Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Uri screenshotUri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".provider", file); sharingIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri); sharingIntent.putExtra(Intent.EXTRA_TEXT, "From FullScreenVideoStatus"); sharingIntent.setType("video/*"); context.startActivity(Intent.createChooser(sharingIntent, "Share video using"));
【问题讨论】:
-
我能想到的只有
Intent.EXTRA_TEXT和Intent.EXTRA_STREAM。对于某些 3rd 方应用程序,它适用于某些它不会。