share - Sharing Android text with the icon of my app -
is possible share text icon of app similiar this?
because i've try works plain text , when try image share entire image, want little thumbnail. that's actual code:
intent intent2=new intent(intent.action_send); intent2.settype("image/*"); intent2.putextra(intent.extra_text,random); uri path = uri.fromfile(new file(image)); intent2.putextra(intent.extra_stream, path ); startactivity(intent.createchooser(intent2, "share via"));
try code:
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(); } share.putextra(intent.extra_stream, uri.parse("file:///sdcard/temporary_file.jpg")); startactivity(intent.createchooser(share, "share image"));
Comments
Post a Comment