How to add Facebook Share button in Android Application

android, facebook

Solution

  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.

Problem

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().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 Use the following link also Best way for social sharing in Android

Original source

Related problems