Question: I use the following method to prevend a outofmemory exception, but the Bitmap ist always null. Has anybody an idea?

```
public Bitmap readBitmap(Android.Net.Uri selectedImage) {

        Bitmap bm = null;
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.InSampleSize = 9;
        AssetFileDescriptor fileDescriptor = null;
        try {
            fileDescriptor =  this.ContentResolver.OpenAssetFileDescriptor(selectedImage,"r");
        } catch (FileNotFoundException e) {
            Toast.MakeText(this, e.Message, ToastLength.Long);
        }
        finally{
            try {
                bm =  BitmapFactory.DecodeFileDescriptor(fileDescriptor.FileDescriptor, null, options);
                fileDescriptor.Close();
            } catch (IOException) {
            }
        }
        return bm;
}

```

Answer: 
Yes. This is another bug of Google. Solution is to do this:

```
bm =  BitmapFactory.decodeStream(new FileInputStream(fileDescriptor));

```

Instead of 

```
bm =  BitmapFactory.DecodeFileDescriptor(fileDescriptor.FileDescriptor, null, options);

```
Perhaps the Uri is incorect and `FileNotFoundException` is thrown. But you can't see this because you are missing the `show()` method of the Toast in the catch clause.

Should be like this:

```
 Toast.MakeText(this, e.Message, ToastLength.Long).show();

```