I am beginner in android.I want to add FacebookShare button in my android application.I create the app in 2.2 .please help me I use this code
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/plain");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,getResources().getString(R.string.title_activity_android_face_book_share));
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,getResources().getString(R.string.title_activity_android_face_book_share));
startActivity(emailIntent);
I Use the following link also Best way for social sharing in Android
Unfortunately, there's no way to force the “Share” button to appear on posts that you mark as “Friends. That's just the way it is now. But that being said, if you really want as many Facebook users as possible to see a given post you can always change its privacy level to “Public”.
It's just as simple to do. Go to the post in question, such as on a Facebook page or friend's account, then select Share. You'll see a list of the people who have shared the post. Depending on the person's privacy settings, you might not see everyone who has shared the post.
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, "URLyouWantToShare");
startActivity(Intent.createChooser(shareIntent, "Share..."));
Use the ACTION_SEND Intent, add the URL you want to share. User will be given a selection of apps to accept the share intent such as facebook etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With