Android 分享文本或图片,,For sharing
分享于 点击 578 次 点评:272
Android 分享文本或图片,,For sharing
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"));
用户点评