Android: File not found on external storage -


i have string filename path pictures folder on external storage android deveices. using string save image opencv. want send share intent share saved image other apps.

highgui.imwrite(filename, image); log.d("writepath", filename); 

in logcat writepath:

/storage/emulated/0/pictures/myimages/image1.jpg

then convert filepath-string uri:

uri lastsaveduri=uri.parse(new file(filename).tostring()) 

and send share intent:

intent shareintent = new intent(); shareintent.setaction(intent.action_send_multiple); shareintent.putparcelablearraylistextra(intent.extra_stream, savedimages); shareintent.settype("image/*"); startactivity(intent.createchooser(shareintent, "share images to..")); 

savedimages arraylist containing multiple lastsaveduri

unfortunately no app can find images trying share. example gmail crashes after clicking send mail , receive logcat error

10-07 10:19:47.265: e/gmail(26264): unable orientation of thumbnail /storage/emulated/0/pictures/myimages/image1.jpg 10-07 10:19:47.265: e/gmail(26264): java.io.filenotfoundexception: no content provider: /storage/emulated/0/pictures/myimages/image1.jpg

why can save images using filepath string why can't share saved images? path not correct , how correct path saved images?

i tried

file savefile = new file(filename); savedimages.add(uri.fromfile(savefile)); 

instead of

uri lastsaveduri=uri.parse(new file(filename).tostring()) savedimages.add(lastsaveduri); 

and working. don't understand why, works.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -