我在这里使用action_send进行Facebook分享仅插入图片但不添加文字是什么原因?

时间:2015-05-28 09:52:34

标签: facebook

这是Facebook共享代码:

String text = "Offer Ends:" + offerending + "\n Offer Type:"
                    + offertype + "\n Address:" + offaddress + "\n"
                    + webbsuitee;

            String completePath = Environment.getExternalStorageDirectory()
                    + "/" + "temporary_file.jpg";

            File file = new File(completePath);
//              Uri imageUri = Uri.fromFile(file);

            Uri imageUri = Uri.fromFile(file);
             Intent shareIntent = new Intent();
             shareIntent.setAction(Intent.ACTION_SEND);
             shareIntent.setType("image/*");
             shareIntent.putExtra(Intent.EXTRA_TEXT, "Hello");
             shareIntent.putExtra(Intent.EXTRA_STREAM, imageUri);

             shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
             startActivity(Intent.createChooser(shareIntent, "send"));

1 个答案:

答案 0 :(得分:0)

它由Facebook API关闭。您需要使用Facebook SDK for Android才能这样做! 检查一下:the docs