title: Picasso image inside a RecyclerView with GridLayoutManager with cardview
body: <p>I'm trying to parse json data which has image and text of a DashboardActivityNew to recyclerView, I'm getting the only problem images from json. I am using Picasso.</p>
  
  <pre><code>RecyclerView recyclerView;
  GridLayoutManager gridLayoutManager;
  ProgressBar progressBarnewdash;
  CustomAdapterDashboard adapterDashboard;
  String url5 = "http://support.deverp.com/dms/dms_menu.aspx";
  List&lt;DataModelNew&gt; list; 
  
  private static final String TAG = DashboardActivityNew.class.getSimpleName();
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      requestWindowFeature(Window.FEATURE_NO_TITLE);
      getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
              WindowManager.LayoutParams.FLAG_FULLSCREEN);
      setContentView(R.layout.activity_dashboard_new);
  
      recyclerView = findViewById(R.id.rvdashboad);
      progressBarnewdash = findViewById(R.id.pbnew1);
      list = new ArrayList&lt;&gt;();
      GridLayoutManager layoutManager = new GridLayoutManager(DashboardActivityNew.this, 3);
  
      loaddata();
      adapterDashboard = new CustomAdapterDashboard(DashboardActivityNew.this, list);
      recyclerView.setLayoutManager(layoutManager);
      recyclerView.setHasFixedSize(true);
      recyclerView.setItemAnimator(new DefaultItemAnimator());
      recyclerView.setNestedScrollingEnabled(false);
  
      recyclerView.setAdapter(adapterDashboard);
      adapterDashboard.notifyDataSetChanged();
  
  
  }
  </code></pre>
  
  <p><strong>This is json call</strong></p>
  
  <pre><code>JSONArray jsonArray = response.getJSONArray("menu");
                                  for (int i = 0; i &lt; jsonArray.length(); i++) {
                                      DataModelNew dataModelNew = new DataModelNew();
                                      JSONObject count = jsonArray.getJSONObject(i);
                                      Log.e("count", count.getString("menuimage"));
  
  
                                      dataModelNew.setMenuhead(count.getString("menuhead"));
                                      dataModelNew.setMenuimage(count.getString("menuimage"));
                                      dataModelNew.setMenutitle(count.getString("menutitle"));
                                      list.add(dataModelNew);
                                      adapterDashboard.notifyDataSetChanged();
  </code></pre>
  
  <p><strong>This is my view holder</strong></p>
  
  <pre><code>@Override
  public void onBindViewHolder(@NonNull final MyViewHolder myViewHolder, final int i) {
  
      myViewHolder.textView1title.setText(list.get(i).getMenutitle());
  
      Log.e("imageholder&gt;&gt;&gt;", list.get(i).getMenuimage() + "");
  
      Picasso.get().load(list.get(i).getMenuimage()).placeholder(R.drawable.erp).fit().into(myViewHolder.imageViewurl, new Callback() {
          @Override
          public void onSuccess() {
              Log.e("success&gt;&gt;&gt;", list.get(i).getMenuimage() + "");
          }
  
          @Override
          public void onError(Exception e) {
              Log.e("error&gt;&gt;&gt;", list.get(i).getMenuimage()+e+ "");
          }
      });
  </code></pre>
  
  <p><strong>This is itemview</strong> </p>
  
  <pre><code>@Override
  public int getItemCount() {
      return list.size();
  }
  public class MyViewHolder extends RecyclerView.ViewHolder {
  
      TextView textView1title, textViewhead;
      ImageView imageViewurl;
      CardView cardViewdash;
  
  
      public MyViewHolder(@NonNull View itemView) {
          super(itemView);
          context = itemView.getContext();
  
          textView1title = itemView.findViewById(R.id.tvdash);
  
          textViewhead = itemView.findViewById(R.id.toolbar_title);
          cardViewdash = itemView.findViewById(R.id.cardnew);
          imageViewurl = (ImageView) itemView.findViewById(R.id.ivdash);
  </code></pre>
  
  <p><strong>This is logcat</strong></p>
  
  <p>I am getting the images both set and get but no loading images and loading images but no display images in my dashboard.</p>
  
  <p><img src="https://i.stack.imgur.com/zWGv5.png" alt="1"></p>
  
  <p><strong>This is my items layout</strong></p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical"&gt;
  
  &lt;android.support.v7.widget.CardView
      android:id="@+id/cardnew"
      android:layout_width="@dimen/_85sdp"
      android:layout_height="@dimen/_76sdp"
      android:layout_margin="5dp"
      android:clickable="true"
      android:foreground="?android:attr/selectableItemBackground"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@drawable/background_dashboard"
          android:gravity="center"
          android:orientation="vertical"&gt;
  
          &lt;ImageView
              android:id="@+id/ivdash"
              android:layout_width="@dimen/_45sdp"
              android:layout_height="@dimen/_45sdp"
              android:background="@color/colorwhite"
              android:padding="10dp"
              android:scaleType="fitXY"
              android:src="@drawable/erp"/&gt;
  
  
          &lt;TextView
              android:id="@+id/tvdash"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="6dp"
              android:ellipsize="marquee"
              android:freezesText="true"
              android:gravity="center"
              android:marqueeRepeatLimit="marquee_forever"
              android:scrollHorizontally="true"
              android:singleLine="true"
              android:text="Quatation Report"
              android:textColor="@color/colorwhite"
              android:textSize="@dimen/_10sdp"
              android:textStyle="bold" /&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p></p>