title: Display Image in android Imageview using Asynctask
body: <p>I have an image being sent to me through a JSON string. I want to convert that string into an image in my android app and then display that image in my imageview.I have a problem, I am using Asynctask and this is my code in the doInBackground method:</p>
  
  <pre><code>protected Boolean doInBackground(final String... args){
  
          JsonParser jsonParser = new JsonParser();
          JSONArray json = jsonParser.getJSONFromUrl(url);
          if(json!=null){
              for (int i = 0; i &lt; json.length(); i++){
                  try{
                      JSONObject c = json.getJSONObject(i);
                      String displayImageFromUrl = c.getString(imageUrl);
                      String clearUrl = displayImageFromUrl.substring(displayImageFromUrl.indexOf(",")+1);
                      byte[] decodingString = Base64.decode(clearUrl, Base64.DEFAULT);
                      bitmap = BitmapFactory.decodeByteArray(decodingString, 0 , decodingString.length);
  
                      String showCreatedDate = c.getString(createdDate);
                      String showArticleTitle = c.getString(articleTitle);
                      HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
  
                      map.put(createdDate, showCreatedDate);
                      map.put(articleTitle, showArticleTitle);
  
                      jsonlist.add(map);
  
                  }catch (Exception e){
                      e.printStackTrace();
                  }
              }
          }else{
  
          }
          return null;
      }
  </code></pre>
  
  <p>and this is my code in the onPostExecute() method:</p>
  
  <pre><code>        protected void onPostExecute(final Boolean success){
          if (dialog.isShowing()) {
              dialog.dismiss();
          }
          Log.d("image please",bitmap.toString());
          ImageView showImage = (ImageView) findViewById(R.id.imageShow);
          showImage.setImageBitmap(bitmap);
          ListAdapter adapter = new SimpleAdapter(context, jsonlist, R.layout.activity_news,
                  new String[] {createdDate, articleTitle},
                  new int[] { R.id.createDate, R.id.articleTitle});
          setListAdapter(adapter);
  
          lv = getListView();
      }
  </code></pre>
  
  <p>Unfortunately nothings shows up in my logcat. Can you help me?
  What do I miss??</p>