hi all,
i have integrated this part of code from the sdk to save images
// Save the name and description in a map. Key is the content provider's
// column name, value is the value to save in that record field.
ContentValues values = *new* ContentValues(3);
values.put(MediaStore.Images.Media.*DISPLAY_NAME*, name);
values.put(MediaStore.Images.Media.*DESCRIPTION*, "Fotos from server");
values.put(MediaStore.Images.Media.*MIME_TYPE*, "image/jpeg");
// Add a new record without the bitmap, but with the values.
// It returns the URI of the new record.
*try* {
Uri uri = getContentResolver().insert(MediaStore.Images.Media.*
INTERNAL_CONTENT_URI*, values);
// Now get a handle to the file for that record, and save the data into it.
// sourceBitmap is a Bitmap object representing the file to save to the
database.
OutputStream outStream = getContentResolver().openOutputStream(uri);
b.compress(Bitmap.CompressFormat.*JPEG*, 50, outStream);
outStream.close();
} *catch* (Exception e) {
Log.*e*("Saved Images", "exception while writing image", e);
}
when i am running the code i am getting exception like
01-02 19:27:10.973: ERROR/DatabaseUtils(142):
java.lang.UnsupportedOperationException: Writing to internal storage is not
supported.
01-02 19:27:10.973: ERROR/DatabaseUtils(142): at
com.android.providers.media.MediaProvider.generateFileName(MediaProvider.java:1117)
01-02 19:27:10.973: ERROR/DatabaseUtils(142): at
com.android.providers.media.MediaProvider.ensureFile(MediaProvider.java:841)
01-02 19:27:11.063: ERROR/Saved Images(27360):
java.lang.UnsupportedOperationException: Writing to internal storage is not
supported.
pls help me out of this
thanx in advance
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---