I want to pick image from gallery and copy it in to other folder in SDCard.
Code to Pick Image from Gallery
Intent photoPickerIntent = new Intent(Int
one solution can be,
1) read bytes from inputStream of the picked file.
i get "content://media/external/images/media/681" this URI onActivityResult. You can get the file name by querying this Uri u got. get inputStream of it. read it into byte[].
here you go/
Uri u = Uri.Parse("content://media/external/images/media/681");
Cursor cursor = contentResolver.query(u, null, null, null, null); there is a column name "_data" which will return you the filename, from filename you can create inputstream,
you can now read this input stream
byte data=new byte[fis.available()];
fis.read(data);
So you have data(byte array) with images byte
2) create a file on to sdcard, and write with byte[] taken in step one.
File file=new File(fileOnSD.getAbsolutePath() +"your foldername", fileName);
FileOutputStream fout=new FileOutputStream(file, false);
fout.write(data);
as fileName you already have from the query method, use same here.