Android app - Adding a “share” button to share the app on social networks

I have an app, and I’d like to add a share button to it. Once the button is clicked, I’d like it to open the following window:
17DJG.jpg

Then the user will choose where to share it and it will display the following default message: “Just found this great app! Find it here:https://play.google.com/store/apps/details?id=com.ideashower.readitlater.pro

Can you please tell me how to do it?

Thanks! Will be very helpful!

Dvir

There are three different ways by which you can do it.

Time for self promotion:

  1. Action bar sherlock for older android versions: https://www.youtube.com/watch?v=bQpeRkBe1Rs
  2. Android direct action bar api for newer android versions: https://www.youtube.com/watch?v=Y1FuepS9hBc
  3. Invoking that dialog from a button inside app/title bar: https://www.youtube.com/watch?v=sRZdP9n9ieM

Corresponding text Version:
How to share data using sherlock action bar in Android | Java Experience
How to share data in Android | Java Experience
How to add share button in Android title bar | Java Experience

Enjoy!!

AND remember to wrap the intent creating in a try{} block… in case Intent.ACTION_SEND is not available. I got bitten by a similar one when trying to launch Google Play …