我想分享图片到snapchat,但却给我“对不起!你只能分享图片和视频”我试过这个代码,但Android share image on snapchat不起作用
我有这样的意图
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("*/*");
intent.setPackage("com.snapchat.android");
int n = Integer.parseInt(number.getText().toString());
Uri uri = Uri.fromFile(new File(db.getimage(n))); //This is retrieving the Uri path from DB
intent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(intent, "Open Snapchat"));发布于 2020-11-06 15:14:49
您为setType方法设置的类型不正确,如果您想支持任何格式的图像,我建议您首先获取图像的格式,然后将正确的参数传递给setType()方法。
要获取文件扩展名,可以使用此链接:link
发布于 2020-12-29 18:18:05
为了在snapchat中共享数据,他们的官方网站上有一个名为Creative Kit的工具包。
您还可以找到文档和教程。
https://stackoverflow.com/questions/64710008
复制相似问题