Gson Request in RecyclerView
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
add a comment |
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
add a comment |
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
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
android-recyclerview android-volley recycler-adapter android-gson recyclerview-layout
edited Nov 13 at 5:37
asked Nov 13 at 5:15
user9155500
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
public void onBindViewHolder(@NonNull final RecyclerVH holder, int position) {
final Study study = inProgressList.get(position);
holder.textbook.setText = study.getMessage();
}
i want to set study_material,study_material_id,study_material_type.
– user9155500
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
add a comment |
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',
autoActivateHeartbeat: false,
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
public void onBindViewHolder(@NonNull final RecyclerVH holder, int position) {
final Study study = inProgressList.get(position);
holder.textbook.setText = study.getMessage();
}
i want to set study_material,study_material_id,study_material_type.
– user9155500
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
add a comment |
public void onBindViewHolder(@NonNull final RecyclerVH holder, int position) {
final Study study = inProgressList.get(position);
holder.textbook.setText = study.getMessage();
}
i want to set study_material,study_material_id,study_material_type.
– user9155500
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
add a comment |
public void onBindViewHolder(@NonNull final RecyclerVH holder, int position) {
final Study study = inProgressList.get(position);
holder.textbook.setText = study.getMessage();
}
public void onBindViewHolder(@NonNull final RecyclerVH holder, int position) {
final Study study = inProgressList.get(position);
holder.textbook.setText = study.getMessage();
}
answered Nov 13 at 7:09
Jarin Rocks
838
838
i want to set study_material,study_material_id,study_material_type.
– user9155500
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
add a comment |
i want to set study_material,study_material_id,study_material_type.
– user9155500
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.
– user9155500
Nov 13 at 8:58
i want to set study_material,study_material_id,study_material_type.
– user9155500
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
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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