Melissa
Melissa

Reputation: 1

Text doesnt show up when I share it to facebook (android studio)

I didnt use the Facebook SDK. I use intend instead. I did the same thing for google+ and Twitter, they work well.However, when I click the bottom for sharing on facebook, the facebook's post page shows up but it didnt show the sharing text on the texing place. It supposes to show a line of text "Hello World.I am testing for my app on Facebook" on the posting place.

Here is my code

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();
                }

            }
        });

Upvotes: 0

Views: 167

Answers (1)

AndroidHacker
AndroidHacker

Reputation: 3596

As per Facebook-v4, you can't share user intended data directly over users timeline.

Facebook have restricted it to do so. Here Facebook states, user should have full control on what they share.

Upvotes: 1

Related Questions