Created
March 14, 2015 20:16
-
-
Save darwind/773f6abf703b5ec18583 to your computer and use it in GitHub Desktop.
Android: sharing photos to Facebook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Uri myImageContentUri; // A content Uri to the image you would like to share. | |
String myAppId = "<Your_Facebook_App_Id>"; | |
Intent shareIntent = new Intent(); | |
shareIntent.setAction(Intent.ACTION_SEND); | |
shareIntent.setType("image/*"); | |
shareIntent.putExtra(Intent.EXTRA_STREAM, myImageContentUri); | |
// Include your Facebook App Id for attribution | |
shareIntent.putExtra("com.facebook.platform.extra.APPLICATION_ID", myAppId); | |
startActivityForResult(Intent.createChooser(shareIntent, "Share"), myRequestId); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment