title: Android: how to convert byte array to Bitmap?
body: <p>I'm trying to convert one image from byte[] to Bitmap to show the image in the Android application. </p>
  
  <p>byte[]'s value is got by database and I checked that it was not null. 
  After that, I would like to convert the image but could not success. The program shows that Bitmap's value is null. </p>
  
  <p>I think there are some problems in converting process. </p>
  
  <p>If you know any tips, please show me. </p>
  
  <pre><code>byte[] image = null;
  Bitmap bitmap = null;
          try {
              if (rset4 != null) {
                  while (rset4.next()) {
                      image = rset4.getBytes("img");
                      BitmapFactory.Options options = new BitmapFactory.Options();
                      bitmap = BitmapFactory.decodeByteArray(image, 0, image.length, options);
                  }
              }
              if (bitmap != null) {
                  ImageView researcher_img = (ImageView) findViewById(R.id.researcher_img);
                  researcher_img.setImageBitmap(bitmap);
                  System.out.println("bitmap is not null");
              } else {
                  System.out.println("bitmap is null");
              }
  
          } catch (SQLException e) {
  
          }
  </code></pre>