当我分享到facebook(android studio)时,文本不显示

时间:2016-11-23 03:46:35

标签: android facebook android-layout android-studio facebook-javascript-sdk

我没有使用Facebook SDK。我改用了。我为谷歌+和Twitter做了同样的事情,他们运作良好。但是,当我点击底部在Facebook上分享时,Facebook的帖子页面显示但它没有显示文本地方的共享文本。它假设在发布地点显示一行文字“Hello World.I我正在Facebook上测试我的应用程序”。

这是我的代码

Button button=(Button)findViewById(R.id.button1);
        button.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                Intent intent = new Intent(Intent.ACTION_SEND);
                intent .setType("text/plain");

                intent .setPackage("com.facebook.katana");
                intent .putExtra(Intent.EXTRA_TEXT, "Hello World.I am testing for my app on Facebook");
                try {
                    startActivity(intent );
                } catch (android.content.ActivityNotFoundException ex) {
                    Toast.makeText(getApplicationContext(),"Facebook has not been installed.", Toast.LENGTH_LONG).show();
                }

            }
        });

1 个答案:

答案 0 :(得分:1)

根据Facebook-v4,您无法直接在用户时间线上共享用户预期的数据。

Facebook限制它这样做。 Facebook表示,用户应该完全控制他们共享的内容。