How to add Facebook Share button in Android app

I am new to android.I want to add FacebookShare button in my Android app. I am creating an application in 2.2.please help me I am using this code

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType("text/plain"); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,getResources().getStriโ€Œโ€‹ng(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 also use the following link The best way to share in Android .

+8
android facebook
source share
1 answer
  Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(Intent.EXTRA_TEXT, "URLyouWantToShare"); startActivity(Intent.createChooser(shareIntent, "Share...")); 

Use the intent ACTION_SEND, add the URL you want to share. The user will be given a choice of applications to accept the intention of sharing, such as facebook, etc.

+23
source share

All Articles