I used Volley library in my apllication for RecyclerView on MainActivity but now when I run my application on android monitor there is saying too much load on main thread
. An also main thread load slowly. What can I do?
How to Solve Too Much Load
64 views Asked by M R Behruz At
3
There are 3 answers
0

Long operations must be executed on the background thread, there are a lot of ways to achieve this : Loaders, Asynctask, handlers ,RXjava, etc.
Refer to this documentation :
https://developer.android.com/reference/android/os/AsyncTask.html https://developer.android.com/training/multiple-threads/communicate-ui.html
0

Use AsyncTask to let long operation task execute under worker threads. So UI thread will not suffer from these heavy payload.
If you are passing small amount of dataset to recyclerview then I suggest you to run the method on runOnUiThread
And if datasets are many(long executable code) then better make use of AsyncTask