How to add Facebook Share button in Android Application

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

Answers


  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.


Need Your Help

Django: How to set DateField to only accept Today & Future dates

python django django-forms datefield

I have been looking for ways to set my Django form to only accept dates that are today or days in the future. I currently have a jQuery datepicker on the frontend, but here is the form field to a

Higher-order functions in Clojure

clojure currying higher-order-functions

Clojure is awesome, we all know this, but that's not the point. I'm wondering what the idiomatic way of creating and managing higher-order functions in a Haskell-like way is. In Clojure I can do the