0

As the title already conveyed what I want to achieve, here is what I'm using:

public void shareVideoWhatsApp() {
    final Intent shareIntent = new Intent(Intent.ACTION_SEND);
    shareIntent.setType("*/*");
    Uri videoUri = FileProvider.getUriForFile(VideoPlayActivity.this,
            BuildConfig.APPLICATION_ID + ".provider", new File("storage/emulated/0/Download/test-8.mp4"));
    shareIntent.putExtra(Intent.EXTRA_STREAM, videoUri);
    Log.d(getClass().getName()+"__VideoURI", "" + videoUri);
    shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
    startActivity(Intent.createChooser(shareIntent, "Share video using"));

}

I'm getting The file format is not supported from whatsapp, any help would be highly appreciated.

  • Use a concrete MIME type, not wildcards. It is your content, so you need to tell the other app what the MIME type is. Also, make sure that your app is able to read this content. – CommonsWare Apr 26 '20 at 12:50
  • `As the title already conveyed what I want to achieve,`. Do not refer to the title. You should put all info in your post. – blackapps Apr 26 '20 at 13:04

0 Answers0