title: My android imageView is black no matter what
body: <p>I try to display an ImageView into my app on a well (hopefully) defined view (XML)</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/activityShowLayout"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="#73C310"
  android:orientation="vertical"
  tools:context=".ShowActivity" &gt;
  
  &lt;ImageView
      android:id="@+id/mainImage"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_above="@+id/moodButton"
      android:layout_alignParentLeft="true"
      android:layout_alignParentRight="true"
      android:layout_alignParentTop="true"
      android:layout_margin="12dp"
      android:background="#000"
      android:src="@drawable/gs_04_pic" /&gt;
  
  &lt;!-- ... --&gt;
  </code></pre>
  
  <p></p>
  
  <p>and after that in my onCreate method on the activity</p>
  
  <pre class="lang-java prettyprint-override"><code>    @Override
  public void onCreate(Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.activity_show);
  
      /* ... blabla bla ... */
  
      ImageView imageView = (ImageView) findViewById(R.id.mainImage);
  
      Bitmap bitmap = BitmapFactory.decodeByteArray(cream.getMedia(), 0, cream.getMedia().length);
      Drawable draw = new BitmapDrawable(getResources(), bitmap);
      imageView.setImageDrawable(draw);
      imageView.invalidate();
  }
  </code></pre>
  
  <p>with cream.getMedia() returning a valid byte[] (from database)
  which I can log giving me: </p>
  
  <blockquote>
    <p>07-18 17:41:16.812: I/app(9883): byte[] is: [B@414af0b0</p>
  </blockquote>
  
  <p>But at the end the imageView is black (no image on it)
  If I don't run the onCreate code it displays the resource set in the XML (on black background as set in XML too)</p>
  
  <p>What is wrong?</p>