I am just trying to get the path to the image that the user selects and then converts it to a bitmap. The problem is that only some of the images in the gallery work when they are selected (by “work” I mean they are found as a file that exists), while others claim that the file does not exist (although the image appears in gallery?). Even stranger is that it does not seem consistent, the image, which at some point is considered "existing", now claims to be missing. My code is below:
----- Purpose: -----
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, GALLERY_ACTIVITY);
----- onActivityForResult -----
Uri uri = intent.getData();
String [] proj={MediaStore.Images.Media.DATA};
Cursor cursor = managedQuery(uri,proj,null,null,null);
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
BitmapFactory.Options opts = new BitmapFactory.Options();<br/>
opts.inSampleSize = 2;<br/>
Bitmap b = BitmapFactory.decodeFile(cursor.getString(column_index),opts);
Any ideas on this would be greatly appreciated, thanks!
Mt.