Android Application with Intents -
i'm trying intent share image sd card. have problem share button: says:
no app can perform action
so, type of code have use share image? want, maybe, have possibility send image e-mail or message. hope can me.
first need store img in storege way
bitmap icon = mbitmap; intent share = new intent(intent.action_send); share.settype("image/jpeg"); bytearrayoutputstream bytes = new bytearrayoutputstream(); icon.compress(bitmap.compressformat.jpeg, 100, bytes); file f = new file(environment.getexternalstoragedirectory() + file.separator + "temporary_file.jpg"); try { f.createnewfile(); fileoutputstream fo = new fileoutputstream(f); fo.write(bytes.tobytearray()); } catch (ioexception e) { e.printstacktrace(); }
and can share way
share.putextra(intent.extra_stream, uri.parse("file:///sdcard/temporary_file.jpg")); startactivity(intent.createchooser(share, "share image"));
Comments
Post a Comment