title: Glide library stopped in AsyncTask.doInBackground
body: <p>I have a Image URL that I retrieved from database and I want to show it inside image view. I use the Glide library for this purpose but I have an <code>Exception</code> while <code>doInBackground</code> is running.</p>
  
  <pre><code>public class Main extends Fragment implements OnClickListener {
  
      private static String url = "http://timit.ir/select/select_pro";
      private static final String TAG_SUCCESS = "success";
      private static final String TAG_PRODUCTS = "product";
      private static final String TAG_PID = "Pro_ID";
      public static final String TAG_PIMAGE = "Url";
      public static final String TAG_PNAME = "Pro_Name";
      public static final String TAG_PRICE = "Price";
      public static final String TAG_DESCRIPTION = "description";
      public static final String TAG_OLDPRICE = "oldPrice";
      public static final String TAG_COMPANYNAME = "companyName";
      public List&lt;Card&gt; cardList;
  
      @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View rootView = inflater.inflate(R.layout.frag_main, container, false);
  
          l1 = (LinearLayout)rootView.findViewById(R.id.horizontal1);
          l2 = (LinearLayout)rootView.findViewById(R.id.horizontal2);
  
          new LoadAllProducts().execute();
  
          return rootView;
      }
  
      class LoadAllProducts extends AsyncTask&lt;String, String, List&lt;Card&gt;&gt; {
          @Override protected List&lt;Card&gt; doInBackground(String... args) {
  
              cardList = new ArrayList&lt;Card&gt;();
              JSONObject json = jParser.makeHttpRequest(url, "GET", params);
  
              // Check your log cat for JSON reponse
              Log.d("All Products: ", json.toString());
  
              try {
                  // Checking for SUCCESS TAG
                  int success = json.getInt(TAG_SUCCESS);
  
                  if (success == 1) {
                      // products found
                      // Getting Array of Products
                      products = json.getJSONArray(TAG_PRODUCTS);
  
                      // looping through All Products
                      for (int i = 0; i &lt; products.length(); i++) {
                          JSONObject c = products.getJSONObject(i);
  
                          Card card = new Card(getActivity());
  
                          Log.d("url:", c.getString(TAG_PIMAGE));
                          Glide.with(Main.this).load(c.getString(TAG_PIMAGE)).into(card.productThumbnailImage);
  
                          card.productId = c.getString(TAG_PID);
                          card.productName.setText(c.getString(TAG_PNAME));
                          card.price.setText(c.getString(TAG_PRICE));
                          card.description.setText(c.getString(TAG_DESCRIPTION));
                          card.companyName.setText(c.getString(TAG_COMPANYNAME));
                          card.oldPrice.setText(c.getString(TAG_OLDPRICE));
  
                          cardList.add(card);
                      }
                      return cardList;
                  }
              } catch (JSONException e) {
                  e.printStackTrace();
              }
  
              return cardList;
          }
  
          @Override protected void onPostExecute(List&lt;Card&gt; lcard) {
              super.onPostExecute(lcard);
              if (lcard.size() != 0) {
                  for (int i = 0; i &lt; lcard.size(); i++) {
                      l1.addView(lcard.get(i));
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>My log: </p>
  
  <blockquote>
    <p>07-02 11:38:59.506: D/url:(4967): <a href="http://timit.ir/product_pic" rel="nofollow">http://timit.ir/product_pic</a>
        /iphone6plusthumnail.png</p>
  </blockquote>