Fixed thread pool simple task

This commit is contained in:
M66B 2018-11-04 12:54:57 +00:00
parent 74c85fab07
commit fd8315202f
2 changed files with 3 additions and 1 deletions

View File

@ -209,6 +209,8 @@ public class FragmentMessages extends FragmentEx {
}); });
rvMessage.setHasFixedSize(false); rvMessage.setHasFixedSize(false);
//rvMessage.setItemViewCacheSize(10);
//rvMessage.getRecycledViewPool().setMaxRecycledViews(0, 10);
LinearLayoutManager llm = new LinearLayoutManager(getContext()); LinearLayoutManager llm = new LinearLayoutManager(getContext());
rvMessage.setLayoutManager(llm); rvMessage.setLayoutManager(llm);

View File

@ -47,7 +47,7 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
private Bundle args; private Bundle args;
private Result stored; private Result stored;
private ExecutorService executor = Executors.newCachedThreadPool(Helper.backgroundThreadFactory); private static ExecutorService executor = Executors.newCachedThreadPool(Helper.backgroundThreadFactory);
public void load(Context context, LifecycleOwner owner, Bundle args) { public void load(Context context, LifecycleOwner owner, Bundle args) {
run(context, owner, args); run(context, owner, args);