简体   繁体   中英

RecyclerView only changes after the screen goes off

I first had a problem retrieving data from localhost then I added the code the

jsonArrayRequest.setRetryPolicy(new DefaultRetryPolicy(0, 0, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));

I no longer got an error.

However the data is only displayed once the screen goes off and I put is back on. Am I missing some line or code or should I remove some line of code?

So I found out the key was to update the recycler adapter to inform it that the data has changed. With this line of code.

adapter.notifyDataSetChanged();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM