Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add share button in android? [duplicate]

Possible Duplicate:
Android facebook/twitter share button

I am creating an app wherein i want to add share button , on clicking the button my app can be shared on facebook and twitter. Please let me know if anyone has a suitable answer which i can implement. Answers will be really appreciated.

like image 882
snn Avatar asked Apr 06 '11 05:04

snn


People also ask

What happens when you click share in Android?

You'll get a notification that someone is sharing content. If you haven't already, to make your device visible, tap the notification. If you're asked to turn on Nearby Share, Bluetooth, or location, tap Turn on.

Where is the share button on Android?

Whether you have an old Pixel phone or the newest Samsung Galaxy S22, the share option in Chrome on an Android phone or tablet is in the More icon's drop-down menu. To access the share button, tap the More icon (3 dots) in the top-right corner.


2 Answers

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/plain");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getResources().getString(R.string.recommendation_subject));
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, getResources().getString(R.string.recommendation_body));
startActivity(emailIntent);

Will prompt user to select appropriate application to perform action with (from installed on the phone)

like image 183
Konstantin Pribluda Avatar answered Oct 17 '22 19:10

Konstantin Pribluda


visit below link to post on fb

http://www.londatiga.net/it/how-to-use-facebook-sdk-to-post-status-from-android/

like image 3
Punit Shah Avatar answered Oct 17 '22 19:10

Punit Shah