0

sololearn I need to share image in the app

I think it will be easier to share some coading images

29th May 2017, 3:44 PM
ismael
ismael - avatar
3 Answers
+ 7
I think @ismael is talking about having options to post images in the discuss section.
29th May 2017, 3:59 PM
Hatsy Rei
Hatsy Rei - avatar
0
Try this code: Button shareButton = (Button) findViewById(R.id.share_button); shareButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent sharingIntent = new Intent(Intent.ACTION_SEND); Uri screenshotUri = Uri.parse("android.resource://com.android.test/*"); try { InputStream stream = getContentResolver().openInputStream(screenshotUri); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } sharingIntent.setType("image/jpeg"); sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri); startActivity(Intent.createChooser(sharingIntent, "Share image using")); } });
29th May 2017, 3:58 PM
Sabiti Christopher
Sabiti Christopher - avatar
0
tnx Hatsy Rei yes I mean in the discuss section
29th May 2017, 5:34 PM
ismael
ismael - avatar