/ Published in: Java
URL: http://stackoverflow.com/questions/3553017/android-share-via-dialog
Expand |
Embed | Plain Text
For sharing an image, like in the example picture, it would be something like this: Intent share = new Intent(Intent.ACTION_SEND); share.setType("image/jpeg"); share.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/DCIM/Camera/myPic.jpg")); startActivity(Intent.createChooser(share, "Share Image")); For text you would use something like: Intent share = new Intent(Intent.ACTION_SEND); share.setType("text/plain"); share.putExtra(Intent.EXTRA_TEXT, "I'm being sent!!"); startActivity(Intent.createChooser(share, "Share Text"));
You need to login to post a comment.
