共享图像不会在V​​iber的和Facebook合作 [英] share image does not work in viber and facebook

查看:197
本文介绍了共享图像不会在V​​iber的和Facebook合作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用的是code以下共享图像,但不幸的是它仅适用于订单,不是的Facebook Viber的

code:

 意图份额=新的意图(android.content.Intent.ACTION_SEND);
 share.setType(图像/ PNG);
 share.putExtra(Intent.EXTRA_STREAM,Uri.parse(G.DIR_APP +/sample_image.png));
 startActivity(Intent.createChooser(份额,共享图片));
 

解决方案

直接分享到Facebook和Viber的...

 意图份额=新的意图(android.content.Intent.ACTION_SEND);
share.setType(图像/ PNG);
share.setPackage(com.facebook.katana);
//为Viber的包是com.viber.voip。
share.putExtra(Intent.EXTRA_STREAM,ImageUri);
startActivity(p_intent.createChooser(份额,分享));
 

I use the code below for sharing images but unfortunately it works only for Line, not for Facebook and Viber

Code:

 Intent share = new Intent(android.content.Intent.ACTION_SEND);
 share.setType("image/png");
 share.putExtra(Intent.EXTRA_STREAM, Uri.parse(G.DIR_APP + "/sample_image.png"));
 startActivity(Intent.createChooser(share, "Share image"));

解决方案

Share directly to Facebook and Viber...

Intent share = new Intent(android.content.Intent.ACTION_SEND);
share.setType("image/png");
share.setPackage("com.facebook.katana"); 
//for viber package is "com.viber.voip".
share.putExtra(Intent.EXTRA_STREAM, ImageUri);
startActivity(p_intent.createChooser(share, "Share With"));

这篇关于共享图像不会在V​​iber的和Facebook合作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆