android - Open image for sharing -


i have android xamarin application imageview onclik lunch intent preview image

file file = new file(photopath); intent intent = new intent(intent.actionview); intent.setdataandtype(uri.fromfile(file), "image/*"); intent.setflags(activityflags.nohistory); startactivity(intent); 

from apps choose 'gallery' when image opend there no sharing options enter image description here

when open image device 'gallery' has sharing options

enter image description here

image saved sd card before preview. doing wrong ?

solution worked me

intent intent = new intent(); intent.putextra(intent.actionview, photopath); intent.settype("image/*"); startactivity(intent.createchooser(intent, "select picture")); 

now image opend in gallery , can use sharing options too


Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -