I want to display Items from the mysql database to my recyclerview but I dont know why it is not displaying anything
Recyclerview
Issue no 1 :- set adapter outside the loop
Issue no 2 :- you forgot to notify your
likelyProblemAdapter
after adding new data in yourmlikelyProblems
Issue no 3 :- layout
Try this
for (int i=0; i<=jsonArray.length()-1; i++){
JSONObject likelyProblemJson = jsonArray.getJSONObject(i);
likelyProblem = likelyProblemJson.getString("problems");
LikelyProblems likelyProblems = new LikelyProblems(likelyProblem);
mlikelyProblems.add(likelyProblems);
}
mRecyclerView.setAdapter(likelyProblemAdapter);\
likelyProblemAdapter.notifyDataSetChanged();
Change your layout like this