GIF正在作为图像而不是动画进行共享-Android Java

GIF正在作为图像而不是动画进行共享-Android Java,java,android,animated-gif,Java,Android,Animated Gif,我试图以编程方式共享GIF,但它正在作为图像共享(未设置动画) 代码段: Intent shareIntent = new Intent(); shareIntent.setType("image/gif");//image/gif shareIntent.setAction(Intent.ACTION_SEND); shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(myList.get(item))); startActivity(Inte

我试图以编程方式共享GIF,但它正在作为图像共享(未设置动画)

代码段:

Intent shareIntent = new Intent();
shareIntent.setType("image/gif");//image/gif
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(myList.get(item)));
startActivity(Intent.createChooser(shareIntent,"Share gif"));

您正在尝试与哪些应用共享

一些whatsapp版本不支持gif功能

您可以在此处检查此问题,并提供一些附加信息:

有这样的评论:

“此解决方案不适用于whatsapp,但适用于我上面指定的所有其他应用程序(即Hangouts、Android消息、Facebook Messenger)”

他指的是这个答案:

private void ShareGif() {

  // replace the path and file name with your gif image path and name
  String baseDir = Environment.getExternalStorageDirectory().getAbsolutePath();
  String fileName = "temporary_file.gif";

  File sharingGifFile = new File(baseDir, fileName);

  Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
  shareIntent.setType("image/gif");
  Uri uri = Uri.fromFile(sharingGifFile);
  shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
  startActivity(Intent.createChooser(shareIntent, "Share image"));

}

/*
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setPackage("com.whatsapp");
shareIntent.putExtra(Intent.EXTRA_TEXT,title + "\n\nLink : " + link );
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(sharePath));
shareIntent.setType("image/*");
startActivity(shareIntent);
*/

希望有帮助。

由谁共享?Android(Java)yo在任何应用程序上共享:ex whatsapp@blackapps你是说如果你用gmail向我发送gif,我将不会收到原始gif吗?很难相信。问题出在文件提供程序中,这里是请求编号。然后问题是您暴露了一个文件uri,该文件uri甚至在调用提供程序之前就抛出了FIleUriExposedException。如果解决了您的问题,您可以将答案标记为正确答案。