android - Unknown URI Error in insertImage -
trying saving bitmap gallery
bitmap bitmap = bitmap.createbitmap(surfaceview.getwidth(), surfaceview.getheight(), bitmap.config.argb_8888); surfaceview.draw(new canvas(bitmap)); mediastore.images.media.insertimage(getcontentresolver(), bitmap, "foo" , "bar");
i ran application on emulator , got unsupportedoperationexception.
07-25 22:27:48.719: e/mediastore(1918): failed insert image 07-25 22:27:48.719: e/mediastore(1918): java.lang.unsupportedoperationexception: unknown uri: content://media/external/images/media 07-25 22:27:48.719: e/mediastore(1918): @ android.database.databaseutils.readexceptionfromparcel(databaseutils.java:168) 07-25 22:27:48.719: e/mediastore(1918): @ android.database.databaseutils.readexceptionfromparcel(databaseutils.java:136) 07-25 22:27:48.719: e/mediastore(1918): @ android.content.contentproviderproxy.insert(contentprovidernative.java:415) 07-25 22:27:48.719: e/mediastore(1918): @ android.content.contentresolver.insert(contentresolver.java:730) 07-25 22:27:48.719: e/mediastore(1918): @ android.provider.mediastore$images$media.insertimage(mediastore.java:801)
unfortunately don't have android device right now, because of emulator? or reason?
i have had similar problems when directory dcim/camera didn't exist on sdcard. creating directory (and having permission) has resolved similar problem me.
Comments
Post a Comment