Hi,
I downloaded a jpg from the net, I'd like to save it to disk then load it again. I'm trying something like this:
Bitmap bmp = ...; // loaded from net.
File file = new File(Environment.getExternalStorageDirectory(), "tmp.jpg");
OutputStream out = getContentResolver().openOutputStream(Uri.parse(file.getAbsolutePath()));
bmp.compress(Bitmap.CompressFormat.JPEG, 70, out);
out.flush();
out.close();
...
File f2 = new File(Environment.getExternalStorageDirectory(), "tmp.jpg");
Uri uri = Uri.fromFile(f2);
but I keep getting an error on the second line when trying to create the new File() instance:
java.io.FileNotFoundException: No content provider: /sdcard/tmp.jpg
I'm using a 2.0 emulator and it has an sdcard. What am I doing wrong?
Thanks