title: Android Download Image through intentservice OK but can't set it in ImageVIew
body: <p>I am struggling with my Android App code...</p>
  
  <p>I am trying to download a picture (via an intentService) and then to display it by adding an ImageView to a LinearLayout.</p>
  
  <p>So far so good, I have the absolutepath sent to my by the intentservice managing the download. I get the toast with the path name. </p>
  
  <p>But I can't display the picture by adding an imageview... And I really don't know why...</p>
  
  <p>At first, I thought my handler could not reach the layout but I managed to display a random image of my resources using setImageResource. So I guess the problem comes either from setimagebitmap or bitmapfactory decode... </p>
  
  <p>In my Intentservice I have (output is the name of my File):</p>
  
  <pre><code>Messenger messenger = (Messenger) extras.get("MESSENGER");
  Message msg = Message.obtain();
  msg.arg1 = result;
  msg.obj = output.getAbsolutePath();
  try {
       messenger.send(msg);
  } etc...
  </code></pre>
  
  <p>Back to my main activity, I have:</p>
  
  <pre><code>Private Handler handler = new Handler() {
      public void handleMessage(Message message) {
  
          // I Get the message
          Object path = message.obj;
  
          //Check if download went ok
          if (message.arg1 == RESULT_OK &amp;&amp; path != null) {
          Toast.makeText(Update3sur3.this,
              "Downloaded" + path.toString(), Toast.LENGTH_LONG)
              .show();
  
              //Try to display the pic
              LinearLayout res2=(LinearLayout)findViewById(R.id.reslayout2);
          ImageView imgView2 = new ImageView(Update3sur3.this);
          Bitmap bitmap= BitmapFactory.decodeFile(path.toString());
          imgView2.setImageBitmap(bitmap);
          res2.addView(imgView2);
      } else {
          Toast.makeText(Update3sur3.this, "Download failed.",
              Toast.LENGTH_LONG).show();
        }
      };
    };
  </code></pre>
  
  <p>Thank you very much!</p>
  
  <p>Laurent</p>