I have a tabbed activity with 6 tabs. It's a lotto ticket picker. I created the grid like this. Every grid has 90 generetad TextViews. The activity start in 2-3 seconds.
Asked
Active
Viewed 50 times
1
-
You could do heavy stuff in a separate thread. – neoexpert Mar 23 '18 at 18:07
-
Is it possible that to move the other fragment creation in the background? with asynctask? or just delayed them? and if yes how? – dobosvok Mar 23 '18 at 18:15
-
You can use lazy loading with RecyclerView + GridLayoutManager – Link182 Mar 23 '18 at 18:28
1 Answers
0
You can do heavy stuff in a thread. In your onCreate method:
Thread t = new Thread() {
public void run() {
//do heavy work here
final int result=42;
runOnUiThread(new Runnable() {
@Override
public void run() {
//call methods of your views here.
textView.setText(result +"");
}
});
}
};
t.start();

neoexpert
- 465
- 1
- 10
- 20