android - How can i send images available in asset folder using intent -


i'm trying send images available in asset folder using intent providing error says shared failed try again later please provide me suggestion.

here i'm doing

intent share = new intent(intent.action_send); share.settype("image/*"); share.putextra(intent.extra_stream, uri.parse("file:///android_asset/1.jpg")); startactivity(intent.createchooser(share, "share image!")); 

i trying using this

 intent share = new intent(intent.action_send); share.settype("image/*"); share.putextra(intent.extra_stream, uri.parse("android.resource://com.example.whatsappshare/asset/1.jpg")); startactivity(intent.createchooser(share, "share image!")); 

both ways providing same result.

once created bitmap said earlier, use following snippet send attachment.

string path = images.media.insertimage(getcontentresolver(), your_bitmap, "title", null); uri screenshoturi = uri.parse(path);  final intent emailintent = new intent(android.content.intent.action_send); emailintent.setflags(intent.flag_activity_new_task); emailintent.putextra(intent.extra_stream, screenshoturi); emailintent.settype("image/png");  startactivity(intent.createchooser(emailintent, "send email using")); 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -