share image does not work in viber and facebook

前端 未结 1 1595
遇见更好的自我
遇见更好的自我 2021-02-12 16:37

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

C

1条回答
  •  深忆病人
    2021-02-12 17:22

    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"));
    

    0 讨论(0)
提交回复
热议问题