Home » Java » java – First Time show fetch data on recyclerview but the second time open recycleview not show data-Exceptionshub

java – First Time show fetch data on recyclerview but the second time open recycleview not show data-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

hi i am developing app to face some problems my problem is if first time open recycleview to fetch data show full correct means first time not problem correct show data but the app is close again reopen recyclerview to not show data. i am using mysql database on working retrofit library
thanx advance.

How to&Answers:

Try calling adapter.notifyDataSetChanged(); in your ShowReport method after setting the adapter.

Also, don’t try to set your adapter in your ShowReport method. Try to set it in onCreate using another list and just add the response in that list in your ShowReport method.

And also, please try to debug the code so that you can know why it’s not showing the data in the second run.