Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/348.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用sdk在Facebook上共享文本_Java_Android_Eclipse_Facebook - Fatal编程技术网

Java 使用sdk在Facebook上共享文本

Java 使用sdk在Facebook上共享文本,java,android,eclipse,facebook,Java,Android,Eclipse,Facebook,我正在开发一个android应用程序,在其中我在facebook上共享内容。我可以分享链接,图片。但当我只在facebook上发布文本时,我无法发送。我什么也没得到。我使用以下代码在facebook上分享 Bundle bundle = new Bundle(); bundle.putString("name", webPageContent); bundle.putString("message", webPageContent); FeedDialogBuilder feedDialog =

我正在开发一个android应用程序,在其中我在facebook上共享内容。我可以分享链接,图片。但当我只在facebook上发布文本时,我无法发送。我什么也没得到。我使用以下代码在facebook上分享

Bundle bundle = new Bundle();
bundle.putString("name", webPageContent);
bundle.putString("message", webPageContent);
FeedDialogBuilder feedDialog = new WebDialog.FeedDialogBuilder(FacebookShareActivity.this,Session.getActiveSession(),bundle)
    .setOnCompleteListener(new OnCompleteListener() {

        @Override
        public void onComplete(Bundle values,
                FacebookException error) {
            // TODO Auto-generated method stub
            if (error == null) {
                // When the story is posted, echo the success
                // and the post Id.
                final String postId = values.getString("post_id");
                if (postId != null) 
                {
                    Toast.makeText(FacebookShareActivity.this, "Posted story, id: "+postId, Toast.LENGTH_SHORT).show();
                }
            }
        }

    });

feedDialog.build().show();

有关提要对话框,请参见文档:

如您所见,没有消息属性。这是因为为用户预先填充状态更新是违反平台策略的