android实现多图文分享朋友圈功能
2017-11-16 14:33
639 查看
很多安卓程序员都在寻找如何调用系统分享可以实现朋友圈多图加文字分享的功能,小编经过测试入坑后,为你整理以下内容:
private void shareMultiplePictureToTimeLine(File... files) { Intent intent = new Intent(); ComponentName comp = new ComponentName("com.tencent.mm", "com.tencent.mm.ui.tools.ShareToTimeLineUI"); intent.setComponent(comp); intent.setAction(Intent.ACTION_SEND_MULTIPLE); intent.setType("image/*"); ArrayList<Uri> imageUris = new ArrayList<Uri>(); for (File f : files) { imageUris.add(Uri.fromFile(f)); } intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris); intent.putExtra("Kdescription", "wwwwwwwwwwwwwwwwwwww"); startActivity(intent); }
localIntent = new Intent("android.intent.action.SEND"); localIntent.putExtra("android.intent.extra.TEXT", paramString1); localIntent.putExtra("sms_body", paramString1); localIntent.putExtra("Kdescription", paramString1); if (localUri1 == null) break; localIntent.putExtra("android.intent.extra.STREAM", localUri1); localIntent.setType("image/*"); context.startActivity(Intent.createChooser(localIntent, "Share"));
其中最关键的就是:
intent.putExtra("Kdescription", text);
文字部分一直分享失败,搞了很久都分享失败后来才发现是需要加上这一句了・・・・・坑!
原来Kdescription是微信描述信息的键。
原因是:微信的代码已经做了代码混淆,因此看起来有些困难,但是仔细观察还是有很多东西可以看出来的。在此类中我们寻找Intent传递的有关key的名称,找到了好几个,因此我们可以一个个来测试,最终发现就是Kdescription这个键来传递描述信息。
您可能感兴趣的文章:
相关文章推荐
- 原生javascript实现分享到朋友圈功能 支持ios和android
- 原生javascript实现分享到朋友圈功能 支持ios和android
- 原生javascript实现分享到朋友圈功能 支持ios和android
- Android实现微信的分享与发送到朋友圈功能
- Android中“分享”功能的实现
- Android 实现微博分享功能
- Android中“分享”功能的实现
- Android中“分享”功能的实现
- android实现分享给好友功能
- Android使用系统Intent实现分享功能及将应用加入分享列表
- android分享功能的实现
- Android App 实现分享功能及将应用加入分享列表 (分享功能可自定义需要分享的APP)
- Android实现分享到为微博、人人等的功能
- Android使用系统Intent实现分享功能及将应用加入分享列表++分享邮箱实现
- android 分享功能实现 即通过其他activity分享
- Android 如何实现分享图片功能
- Android中“分享”功能的实现
- 实现android分享到其他安装用户功能
- android 实现分享功能
- android分享功能的实现