Gson Request in RecyclerView











up vote
0
down vote

favorite












I want to set the response data to the layout. i success to get the response.
How can i set the response data to the particular fields in recyclerview?
How can i set container_id,title,description,tag? these fields are inside in the result model class. result class is inside the study model class. how can i find and set to the layout.



Request Fragment Class :



 public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
final ArrayList<Study> todoArrayList = new ArrayList<Study>();

textView = view.findViewById(R.id.txt_book_name);

Map<String, String> header = new HashMap<>();
header.put("Content-Type", "application/x-www-form-urlencoded");

Map<String, String> params = new HashMap<>();
params.put("fire", "study-material");
params.put("job_id", "317");

RequestQueue requestQueue;
requestQueue = Volley.newRequestQueue(Objects.requireNonNull(getContext()));

GsonRequest<Study> gsonRequest = new GsonRequest<>(Request.Method.POST, url, Study.class, header, params,
new Response.Listener<Study>() {
@Override
public void onResponse(Study response) {


List resultList = new ArrayList<>();



                    Result result = new Result();

result.setContent_id(result.getContent_id());
result.setTitle(result.getTitle());

resultList.add(result);

todoArrayList.add(new Study(response.getMessage(),resultList,response.getStatus()));


Log.d(TAG, response);

}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {

Log.d(TAG,error.toString());
}
});

requestQueue.add(gsonRequest);

final AdapterForStudy itemsAdapter = new AdapterForStudy(TodoFragment.this.getActivity(), todoArrayList);
final RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycle);
GridLayoutManager gridLayoutManager = new GridLayoutManager(TodoFragment.this.getActivity(), 2);
recyclerView.setLayoutManager(gridLayoutManager);
recyclerView.setHasFixedSize(true);
recyclerView.setAdapter(itemsAdapter);
}


Adapter For recyclerView :



public class AdapterForStudy extends RecyclerView.Adapter<AdapterForStudy.RecyclerVH> {
private Context mCtx;
private List<Study> inProgressList;

public AdapterForStudy(Context mCtx, List<Study> inProgressList) {
this.mCtx = mCtx;
this.inProgressList = inProgressList;
}

@NonNull
@Override
public RecyclerVH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater layoutInflater = LayoutInflater.from(mCtx);
View view = layoutInflater.inflate(R.layout.list_todo, parent, false);
return new AdapterForStudy.RecyclerVH(view);
}


@Override
public void onBindViewHolder(@NonNull final RecyclerVH holder, int position) {

final Study study = inProgressList.get(position);

holder.imgDownload.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
holder.imgDownload.setImageResource(R.drawable.ic_file_download_green_24dp);
}
});

holder.imgBookmark.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
holder.imgBookmark.setImageResource(R.drawable.ic_bookmark_green_24dp);
}
});
}

@Override
public int getItemCount() {
return inProgressList.size();
}

public class RecyclerVH extends RecyclerView.ViewHolder {
TextView txtBook, txtAuthor, txtPage;
ImageButton imgDownload, imgBookmark;

public RecyclerVH(@NonNull View itemView) {
super(itemView);
txtBook = itemView.findViewById(R.id.txt_book_name);
txtAuthor = itemView.findViewById(R.id.txt_author);
txtPage = itemView.findViewById(R.id.txt_pages);
imgDownload = itemView.findViewById(R.id.img_download);
imgBookmark = itemView.findViewById(R.id.img_bookmark);
}
}


}



Model Classes :



public class Study {
private String message;

private List<Result> result;

private String status;

public Study(String message, List<Result> result, String status) {
this.message = message;
this.result = result;
this.status = status;
}

public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}

public List<Result> getResult() {
return result;
}

public void setResult(List<Result> result) {
this.result = result;
}

public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}


}



public class Result {
private String tags;

private List<Study_materials> study_materials;

private String title;

private String content_id;

private String description;

public String getTags() {
return tags;
}

public void setTags(String tags) {
this.tags = tags;
}

public List<Study_materials> getStudy_materials() {
return study_materials;
}

public void setStudy_materials(List<Study_materials> study_materials) {
this.study_materials = study_materials;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getContent_id() {
return content_id;
}

public void setContent_id(String content_id) {
this.content_id = content_id;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}


}



public class Study_materials {
private String study_material_id;

private String material_type;

private String study_material;

public String getStudy_material_id() {
return study_material_id;
}

public void setStudy_material_id(String study_material_id) {
this.study_material_id = study_material_id;
}

public String getMaterial_type() {
return material_type;
}

public void setMaterial_type(String material_type) {
this.material_type = material_type;
}

public String getStudy_material() {
return study_material;
}

public void setStudy_material(String study_material) {
this.study_material = study_material;
}


}










share|improve this question




























    up vote
    0
    down vote

    favorite












    I want to set the response data to the layout. i success to get the response.
    How can i set the response data to the particular fields in recyclerview?
    How can i set container_id,title,description,tag? these fields are inside in the result model class. result class is inside the study model class. how can i find and set to the layout.



    Request Fragment Class :



     public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    final ArrayList<Study> todoArrayList = new ArrayList<Study>();

    textView = view.findViewById(R.id.txt_book_name);

    Map<String, String> header = new HashMap<>();
    header.put("Content-Type", "application/x-www-form-urlencoded");

    Map<String, String> params = new HashMap<>();
    params.put("fire", "study-material");
    params.put("job_id", "317");

    RequestQueue requestQueue;
    requestQueue = Volley.newRequestQueue(Objects.requireNonNull(getContext()));

    GsonRequest<Study> gsonRequest = new GsonRequest<>(Request.Method.POST, url, Study.class, header, params,
    new Response.Listener<Study>() {
    @Override
    public void onResponse(Study response) {


    List resultList = new ArrayList<>();



                        Result result = new Result();

    result.setContent_id(result.getContent_id());
    result.setTitle(result.getTitle());

    resultList.add(result);

    todoArrayList.add(new Study(response.getMessage(),resultList,response.getStatus()));


    Log.d(TAG, response);

    }
    }, new Response.ErrorListener() {
    @Override
    public void onErrorResponse(VolleyError error) {

    Log.d(TAG,error.toString());
    }
    });

    requestQueue.add(gsonRequest);

    final AdapterForStudy itemsAdapter = new AdapterForStudy(TodoFragment.this.getActivity(), todoArrayList);
    final RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycle);
    GridLayoutManager gridLayoutManager = new GridLayoutManager(TodoFragment.this.getActivity(), 2);
    recyclerView.setLayoutManager(gridLayoutManager);
    recyclerView.setHasFixedSize(true);
    recyclerView.setAdapter(itemsAdapter);
    }


    Adapter For recyclerView :



    public class AdapterForStudy extends RecyclerView.Adapter<AdapterForStudy.RecyclerVH> {
    private Context mCtx;
    private List<Study> inProgressList;

    public AdapterForStudy(Context mCtx, List<Study> inProgressList) {
    this.mCtx = mCtx;
    this.inProgressList = inProgressList;
    }

    @NonNull
    @Override
    public RecyclerVH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
    LayoutInflater layoutInflater = LayoutInflater.from(mCtx);
    View view = layoutInflater.inflate(R.layout.list_todo, parent, false);
    return new AdapterForStudy.RecyclerVH(view);
    }


    @Override
    public void onBindViewHolder(@NonNull final RecyclerVH holder, int position) {

    final Study study = inProgressList.get(position);

    holder.imgDownload.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
    holder.imgDownload.setImageResource(R.drawable.ic_file_download_green_24dp);
    }
    });

    holder.imgBookmark.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
    holder.imgBookmark.setImageResource(R.drawable.ic_bookmark_green_24dp);
    }
    });
    }

    @Override
    public int getItemCount() {
    return inProgressList.size();
    }

    public class RecyclerVH extends RecyclerView.ViewHolder {
    TextView txtBook, txtAuthor, txtPage;
    ImageButton imgDownload, imgBookmark;

    public RecyclerVH(@NonNull View itemView) {
    super(itemView);
    txtBook = itemView.findViewById(R.id.txt_book_name);
    txtAuthor = itemView.findViewById(R.id.txt_author);
    txtPage = itemView.findViewById(R.id.txt_pages);
    imgDownload = itemView.findViewById(R.id.img_download);
    imgBookmark = itemView.findViewById(R.id.img_bookmark);
    }
    }


    }



    Model Classes :



    public class Study {
    private String message;

    private List<Result> result;

    private String status;

    public Study(String message, List<Result> result, String status) {
    this.message = message;
    this.result = result;
    this.status = status;
    }

    public String getMessage() {
    return message;
    }

    public void setMessage(String message) {
    this.message = message;
    }

    public List<Result> getResult() {
    return result;
    }

    public void setResult(List<Result> result) {
    this.result = result;
    }

    public String getStatus() {
    return status;
    }

    public void setStatus(String status) {
    this.status = status;
    }


    }



    public class Result {
    private String tags;

    private List<Study_materials> study_materials;

    private String title;

    private String content_id;

    private String description;

    public String getTags() {
    return tags;
    }

    public void setTags(String tags) {
    this.tags = tags;
    }

    public List<Study_materials> getStudy_materials() {
    return study_materials;
    }

    public void setStudy_materials(List<Study_materials> study_materials) {
    this.study_materials = study_materials;
    }

    public String getTitle() {
    return title;
    }

    public void setTitle(String title) {
    this.title = title;
    }

    public String getContent_id() {
    return content_id;
    }

    public void setContent_id(String content_id) {
    this.content_id = content_id;
    }

    public String getDescription() {
    return description;
    }

    public void setDescription(String description) {
    this.description = description;
    }


    }



    public class Study_materials {
    private String study_material_id;

    private String material_type;

    private String study_material;

    public String getStudy_material_id() {
    return study_material_id;
    }

    public void setStudy_material_id(String study_material_id) {
    this.study_material_id = study_material_id;
    }

    public String getMaterial_type() {
    return material_type;
    }

    public void setMaterial_type(String material_type) {
    this.material_type = material_type;
    }

    public String getStudy_material() {
    return study_material;
    }

    public void setStudy_material(String study_material) {
    this.study_material = study_material;
    }


    }










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I want to set the response data to the layout. i success to get the response.
      How can i set the response data to the particular fields in recyclerview?
      How can i set container_id,title,description,tag? these fields are inside in the result model class. result class is inside the study model class. how can i find and set to the layout.



      Request Fragment Class :



       public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
      super.onViewCreated(view, savedInstanceState);
      final ArrayList<Study> todoArrayList = new ArrayList<Study>();

      textView = view.findViewById(R.id.txt_book_name);

      Map<String, String> header = new HashMap<>();
      header.put("Content-Type", "application/x-www-form-urlencoded");

      Map<String, String> params = new HashMap<>();
      params.put("fire", "study-material");
      params.put("job_id", "317");

      RequestQueue requestQueue;
      requestQueue = Volley.newRequestQueue(Objects.requireNonNull(getContext()));

      GsonRequest<Study> gsonRequest = new GsonRequest<>(Request.Method.POST, url, Study.class, header, params,
      new Response.Listener<Study>() {
      @Override
      public void onResponse(Study response) {


      List resultList = new ArrayList<>();



                          Result result = new Result();

      result.setContent_id(result.getContent_id());
      result.setTitle(result.getTitle());

      resultList.add(result);

      todoArrayList.add(new Study(response.getMessage(),resultList,response.getStatus()));


      Log.d(TAG, response);

      }
      }, new Response.ErrorListener() {
      @Override
      public void onErrorResponse(VolleyError error) {

      Log.d(TAG,error.toString());
      }
      });

      requestQueue.add(gsonRequest);

      final AdapterForStudy itemsAdapter = new AdapterForStudy(TodoFragment.this.getActivity(), todoArrayList);
      final RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycle);
      GridLayoutManager gridLayoutManager = new GridLayoutManager(TodoFragment.this.getActivity(), 2);
      recyclerView.setLayoutManager(gridLayoutManager);
      recyclerView.setHasFixedSize(true);
      recyclerView.setAdapter(itemsAdapter);
      }


      Adapter For recyclerView :



      public class AdapterForStudy extends RecyclerView.Adapter<AdapterForStudy.RecyclerVH> {
      private Context mCtx;
      private List<Study> inProgressList;

      public AdapterForStudy(Context mCtx, List<Study> inProgressList) {
      this.mCtx = mCtx;
      this.inProgressList = inProgressList;
      }

      @NonNull
      @Override
      public RecyclerVH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
      LayoutInflater layoutInflater = LayoutInflater.from(mCtx);
      View view = layoutInflater.inflate(R.layout.list_todo, parent, false);
      return new AdapterForStudy.RecyclerVH(view);
      }


      @Override
      public void onBindViewHolder(@NonNull final RecyclerVH holder, int position) {

      final Study study = inProgressList.get(position);

      holder.imgDownload.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
      holder.imgDownload.setImageResource(R.drawable.ic_file_download_green_24dp);
      }
      });

      holder.imgBookmark.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
      holder.imgBookmark.setImageResource(R.drawable.ic_bookmark_green_24dp);
      }
      });
      }

      @Override
      public int getItemCount() {
      return inProgressList.size();
      }

      public class RecyclerVH extends RecyclerView.ViewHolder {
      TextView txtBook, txtAuthor, txtPage;
      ImageButton imgDownload, imgBookmark;

      public RecyclerVH(@NonNull View itemView) {
      super(itemView);
      txtBook = itemView.findViewById(R.id.txt_book_name);
      txtAuthor = itemView.findViewById(R.id.txt_author);
      txtPage = itemView.findViewById(R.id.txt_pages);
      imgDownload = itemView.findViewById(R.id.img_download);
      imgBookmark = itemView.findViewById(R.id.img_bookmark);
      }
      }


      }



      Model Classes :



      public class Study {
      private String message;

      private List<Result> result;

      private String status;

      public Study(String message, List<Result> result, String status) {
      this.message = message;
      this.result = result;
      this.status = status;
      }

      public String getMessage() {
      return message;
      }

      public void setMessage(String message) {
      this.message = message;
      }

      public List<Result> getResult() {
      return result;
      }

      public void setResult(List<Result> result) {
      this.result = result;
      }

      public String getStatus() {
      return status;
      }

      public void setStatus(String status) {
      this.status = status;
      }


      }



      public class Result {
      private String tags;

      private List<Study_materials> study_materials;

      private String title;

      private String content_id;

      private String description;

      public String getTags() {
      return tags;
      }

      public void setTags(String tags) {
      this.tags = tags;
      }

      public List<Study_materials> getStudy_materials() {
      return study_materials;
      }

      public void setStudy_materials(List<Study_materials> study_materials) {
      this.study_materials = study_materials;
      }

      public String getTitle() {
      return title;
      }

      public void setTitle(String title) {
      this.title = title;
      }

      public String getContent_id() {
      return content_id;
      }

      public void setContent_id(String content_id) {
      this.content_id = content_id;
      }

      public String getDescription() {
      return description;
      }

      public void setDescription(String description) {
      this.description = description;
      }


      }



      public class Study_materials {
      private String study_material_id;

      private String material_type;

      private String study_material;

      public String getStudy_material_id() {
      return study_material_id;
      }

      public void setStudy_material_id(String study_material_id) {
      this.study_material_id = study_material_id;
      }

      public String getMaterial_type() {
      return material_type;
      }

      public void setMaterial_type(String material_type) {
      this.material_type = material_type;
      }

      public String getStudy_material() {
      return study_material;
      }

      public void setStudy_material(String study_material) {
      this.study_material = study_material;
      }


      }










      share|improve this question















      I want to set the response data to the layout. i success to get the response.
      How can i set the response data to the particular fields in recyclerview?
      How can i set container_id,title,description,tag? these fields are inside in the result model class. result class is inside the study model class. how can i find and set to the layout.



      Request Fragment Class :



       public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
      super.onViewCreated(view, savedInstanceState);
      final ArrayList<Study> todoArrayList = new ArrayList<Study>();

      textView = view.findViewById(R.id.txt_book_name);

      Map<String, String> header = new HashMap<>();
      header.put("Content-Type", "application/x-www-form-urlencoded");

      Map<String, String> params = new HashMap<>();
      params.put("fire", "study-material");
      params.put("job_id", "317");

      RequestQueue requestQueue;
      requestQueue = Volley.newRequestQueue(Objects.requireNonNull(getContext()));

      GsonRequest<Study> gsonRequest = new GsonRequest<>(Request.Method.POST, url, Study.class, header, params,
      new Response.Listener<Study>() {
      @Override
      public void onResponse(Study response) {


      List resultList = new ArrayList<>();



                          Result result = new Result();

      result.setContent_id(result.getContent_id());
      result.setTitle(result.getTitle());

      resultList.add(result);

      todoArrayList.add(new Study(response.getMessage(),resultList,response.getStatus()));


      Log.d(TAG, response);

      }
      }, new Response.ErrorListener() {
      @Override
      public void onErrorResponse(VolleyError error) {

      Log.d(TAG,error.toString());
      }
      });

      requestQueue.add(gsonRequest);

      final AdapterForStudy itemsAdapter = new AdapterForStudy(TodoFragment.this.getActivity(), todoArrayList);
      final RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycle);
      GridLayoutManager gridLayoutManager = new GridLayoutManager(TodoFragment.this.getActivity(), 2);
      recyclerView.setLayoutManager(gridLayoutManager);
      recyclerView.setHasFixedSize(true);
      recyclerView.setAdapter(itemsAdapter);
      }


      Adapter For recyclerView :



      public class AdapterForStudy extends RecyclerView.Adapter<AdapterForStudy.RecyclerVH> {
      private Context mCtx;
      private List<Study> inProgressList;

      public AdapterForStudy(Context mCtx, List<Study> inProgressList) {
      this.mCtx = mCtx;
      this.inProgressList = inProgressList;
      }

      @NonNull
      @Override
      public RecyclerVH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
      LayoutInflater layoutInflater = LayoutInflater.from(mCtx);
      View view = layoutInflater.inflate(R.layout.list_todo, parent, false);
      return new AdapterForStudy.RecyclerVH(view);
      }


      @Override
      public void onBindViewHolder(@NonNull final RecyclerVH holder, int position) {

      final Study study = inProgressList.get(position);

      holder.imgDownload.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
      holder.imgDownload.setImageResource(R.drawable.ic_file_download_green_24dp);
      }
      });

      holder.imgBookmark.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
      holder.imgBookmark.setImageResource(R.drawable.ic_bookmark_green_24dp);
      }
      });
      }

      @Override
      public int getItemCount() {
      return inProgressList.size();
      }

      public class RecyclerVH extends RecyclerView.ViewHolder {
      TextView txtBook, txtAuthor, txtPage;
      ImageButton imgDownload, imgBookmark;

      public RecyclerVH(@NonNull View itemView) {
      super(itemView);
      txtBook = itemView.findViewById(R.id.txt_book_name);
      txtAuthor = itemView.findViewById(R.id.txt_author);
      txtPage = itemView.findViewById(R.id.txt_pages);
      imgDownload = itemView.findViewById(R.id.img_download);
      imgBookmark = itemView.findViewById(R.id.img_bookmark);
      }
      }


      }



      Model Classes :



      public class Study {
      private String message;

      private List<Result> result;

      private String status;

      public Study(String message, List<Result> result, String status) {
      this.message = message;
      this.result = result;
      this.status = status;
      }

      public String getMessage() {
      return message;
      }

      public void setMessage(String message) {
      this.message = message;
      }

      public List<Result> getResult() {
      return result;
      }

      public void setResult(List<Result> result) {
      this.result = result;
      }

      public String getStatus() {
      return status;
      }

      public void setStatus(String status) {
      this.status = status;
      }


      }



      public class Result {
      private String tags;

      private List<Study_materials> study_materials;

      private String title;

      private String content_id;

      private String description;

      public String getTags() {
      return tags;
      }

      public void setTags(String tags) {
      this.tags = tags;
      }

      public List<Study_materials> getStudy_materials() {
      return study_materials;
      }

      public void setStudy_materials(List<Study_materials> study_materials) {
      this.study_materials = study_materials;
      }

      public String getTitle() {
      return title;
      }

      public void setTitle(String title) {
      this.title = title;
      }

      public String getContent_id() {
      return content_id;
      }

      public void setContent_id(String content_id) {
      this.content_id = content_id;
      }

      public String getDescription() {
      return description;
      }

      public void setDescription(String description) {
      this.description = description;
      }


      }



      public class Study_materials {
      private String study_material_id;

      private String material_type;

      private String study_material;

      public String getStudy_material_id() {
      return study_material_id;
      }

      public void setStudy_material_id(String study_material_id) {
      this.study_material_id = study_material_id;
      }

      public String getMaterial_type() {
      return material_type;
      }

      public void setMaterial_type(String material_type) {
      this.material_type = material_type;
      }

      public String getStudy_material() {
      return study_material;
      }

      public void setStudy_material(String study_material) {
      this.study_material = study_material;
      }


      }







      android-recyclerview android-volley recycler-adapter android-gson recyclerview-layout






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 13 at 5:37

























      asked Nov 13 at 5:15









      Karthick Raja

      105




      105
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          public void onBindViewHolder(@NonNull final RecyclerVH holder, int position) {

          final Study study = inProgressList.get(position);
          holder.textbook.setText = study.getMessage();

          }





          share|improve this answer





















          • i want to set study_material,study_material_id,study_material_type.
            – Karthick Raja
            Nov 13 at 8:58










          • Then pass the list Study materials in to the recycler view instead of Study.
            – Jarin Rocks
            Nov 13 at 10:54











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53274244%2fgson-request-in-recyclerview%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          public void onBindViewHolder(@NonNull final RecyclerVH holder, int position) {

          final Study study = inProgressList.get(position);
          holder.textbook.setText = study.getMessage();

          }





          share|improve this answer





















          • i want to set study_material,study_material_id,study_material_type.
            – Karthick Raja
            Nov 13 at 8:58










          • Then pass the list Study materials in to the recycler view instead of Study.
            – Jarin Rocks
            Nov 13 at 10:54















          up vote
          0
          down vote













          public void onBindViewHolder(@NonNull final RecyclerVH holder, int position) {

          final Study study = inProgressList.get(position);
          holder.textbook.setText = study.getMessage();

          }





          share|improve this answer





















          • i want to set study_material,study_material_id,study_material_type.
            – Karthick Raja
            Nov 13 at 8:58










          • Then pass the list Study materials in to the recycler view instead of Study.
            – Jarin Rocks
            Nov 13 at 10:54













          up vote
          0
          down vote










          up vote
          0
          down vote









          public void onBindViewHolder(@NonNull final RecyclerVH holder, int position) {

          final Study study = inProgressList.get(position);
          holder.textbook.setText = study.getMessage();

          }





          share|improve this answer












          public void onBindViewHolder(@NonNull final RecyclerVH holder, int position) {

          final Study study = inProgressList.get(position);
          holder.textbook.setText = study.getMessage();

          }






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 13 at 7:09









          Jarin Rocks

          738




          738












          • i want to set study_material,study_material_id,study_material_type.
            – Karthick Raja
            Nov 13 at 8:58










          • Then pass the list Study materials in to the recycler view instead of Study.
            – Jarin Rocks
            Nov 13 at 10:54


















          • i want to set study_material,study_material_id,study_material_type.
            – Karthick Raja
            Nov 13 at 8:58










          • Then pass the list Study materials in to the recycler view instead of Study.
            – Jarin Rocks
            Nov 13 at 10:54
















          i want to set study_material,study_material_id,study_material_type.
          – Karthick Raja
          Nov 13 at 8:58




          i want to set study_material,study_material_id,study_material_type.
          – Karthick Raja
          Nov 13 at 8:58












          Then pass the list Study materials in to the recycler view instead of Study.
          – Jarin Rocks
          Nov 13 at 10:54




          Then pass the list Study materials in to the recycler view instead of Study.
          – Jarin Rocks
          Nov 13 at 10:54


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53274244%2fgson-request-in-recyclerview%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

          How to change which sound is reproduced for terminal bell?

          Can I use Tabulator js library in my java Spring + Thymeleaf project?