title: Locally stored images are not displayed in the CardView inside a RecyclerView
body: <p>I have a <code>RecyclerView</code> which has <code>CardView</code> as its list items. The <code>CardView</code> have only 2 <code>TextView</code> and one <code>ImageView</code>.</p>
  
  <pre><code>&lt;android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="70dp"
      android:layout_marginTop="2dp"
      android:layout_marginBottom="2dp"
      android:id="@+id/dcCardView"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="horizontal"
          android:background="@drawable/detail_coast_cardview_bg"&gt;
  
          &lt;ImageView
              android:id="@+id/dcImage"
              android:layout_width="40dp"
              android:layout_height="40dp"
              android:layout_marginStart="8dp"
              android:src="@drawable/radiation"
              android:layout_gravity="center_vertical" /&gt;
  
          &lt;LinearLayout
              android:layout_gravity="center_vertical"
              android:layout_marginStart="16dp"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"&gt;
  
          &lt;TextView
              android:id="@+id/dcName"
              android:textColor="#fff"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="212"
              android:textSize="18dp" /&gt;
  
          &lt;TextView
              android:textColor="#fff"
              android:id="@+id/dcValue"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="renu asdasasd"
              android:textSize="18dp" /&gt;
  
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p>The class that goes in it is this</p>
  
  <pre><code>public class DetailedCoastRecyclerView {
  
      //region fields
      private String name;
      private String value;
      private int imageName;
      //end region fields
  
      //constructor
      public DetailedCoastRecyclerView() {}
  
      public DetailedCoastRecyclerView(String name, String value, int image) {
          this.name = name;
          this.value = value;
          this.imageName = image;
      }
  
      public String getName() {
          return name;
      }
  
      public String getValue() {
          return value;
      }
  
      public int getImageName() {
          return imageName;
      }
  }
  </code></pre>
  
  <p>And my <code>CoastDetailsActivity2</code></p>
  
  <pre><code>public class CoastDetailsActivity2 extends AppCompatActivity {
  
      private Context context;
      private SharedPreferences sharedPreferences;
      private SharedPreferences.Editor editor;
      private int coastId;
      private String jsonCoastDetailsString = "";
      private RecyclerView recyclerView;
      private DetailedCoastAdapter detailedCoastAdapter;
      private ImageView btnBlueFlag;
      private ImageView btnHandycapFriendly;
      private ImageView btnFavorite;
      private ImageView btnWaze;
      private LinearLayout mainLayout;
      private Beach mBeach;
  
      private TextView tvBeachName;
  
      private DetailedCoastWithForcast detailedCoastWithForcast;
      private DetailedBeachMetadata detailedBeachMetadata;
      private DetailedBeachHourlyForecast dbhfToday;
      private List&lt;DetailedCoastRecyclerView&gt; detailedCoastRecyclerViewList = new ArrayList&lt;&gt;();
      private Map&lt;String, String&gt; windBearing = new HashMap&lt;&gt;();
      private Map&lt;String, String&gt; jellyType = new HashMap&lt;&gt;();
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_coast_details2);
  
          setPointer();
      }
  
      private void setPointer() {
          this.context = this;
          mainLayout = (LinearLayout) findViewById(R.id.mainLayout);
          sharedPreferences = context.getSharedPreferences(sharedPreferencesName, MODE_PRIVATE);
          editor = sharedPreferences.edit();
          tvBeachName = (TextView) findViewById(R.id.tvBeachName);
  
          //start the forecast activity
          tvBeachName.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent intent = new Intent(context, ForecastActivity.class);
                  intent.putExtra("coastId", coastId);
                  startActivity(intent);
              }
          });
  
          AndroidNetworking.initialize(context);
  
          //get the coastId
          Bundle extras = getIntent().getExtras();
          if (extras == null) {
              //TODO add snackbar for error
          } else {
              coastId = extras.getInt("coastId");
          }
  
          getBeachDetails();
  
          recyclerView = (RecyclerView) findViewById(R.id.dcRecyclerView);
          detailedCoastAdapter = new DetailedCoastAdapter(detailedCoastRecyclerViewList, context);
          RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false);
          recyclerView.setLayoutManager(layoutManager);
          recyclerView.setItemAnimator(new DefaultItemAnimator());
          recyclerView.setAdapter(detailedCoastAdapter);
      }
  }
  </code></pre>
  
  <p>And the adapter</p>
  
  <pre><code>public class ForecastAdapter extends RecyclerView.Adapter&lt;ForecastAdapter.myViewHolder&gt; {
  
      Context context;
      private List&lt;DetailedCoastRecyclerView&gt; dbhf0;
  
      public ForecastAdapter(Context context, List&lt;DetailedCoastRecyclerView&gt; dbhf0) {
          this.context = context;
          this.dbhf0 = dbhf0;
      }
  
      @Override
      public myViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View view = LayoutInflater.from(context).inflate(R.layout.detailed_coast_card, parent, false);
          return new myViewHolder(view);
      }
  
      @Override
      public void onBindViewHolder(myViewHolder holder, int position) {
          DetailedCoastRecyclerView dcrv = dbhf0.get(position);
          holder.tvName.setText(dcrv.getName());
          holder.tvValue.setText(dcrv.getValue());
          //holder.ivImage.setImageResource(dcrv.getImageName());
          Glide.with(context).load(dcrv.getImageName()).into(holder.ivImage);
      }
  
      @Override
      public int getItemCount() {
          return dbhf0.size();
      }
  
      public class myViewHolder extends RecyclerView.ViewHolder {
  
          ImageView ivImage;
          TextView tvName;
          TextView tvValue;
  
          public myViewHolder(View itemView) {
              super(itemView);
              ivImage = (ImageView) itemView.findViewById(R.id.dcImage);
              tvName = (TextView) itemView.findViewById(R.id.dcName);
              tvValue = (TextView) itemView.findViewById(R.id.dcValue);
          }
      }
  }
  </code></pre>
  
  <p>When I run it, the <code>getBeachDetails()</code> method gets all the info from the server, add it to an <code>ArrayList</code> and calls <code>notifyDataSetChanged()</code> on the adapter.</p>
  
  <p>I know its working because I see the name and value for every card but the images which are stored locally are not displayed.</p>
  
  <p>I use the same adapter inside a <code>ViewPager</code> with 3 fragments and there everything is ok.</p>
  
  <p>Any ideas?</p>