I have to populate an activity with up to 100 different fragments to iterate through all fragments i am using a for loop, but instead of it adding a fragment one by one it adds all the fragments at once. till that happens app freezes, sometimes it freezes for 4-5 seconds. How to load them one by one? Heres what i have done till now...
for (i = 0; i < combofinalist.size(); i++) {
Bundle c = new Bundle();
fm = getSupportFragmentManager();
ft = fm.beginTransaction();
combofrag combofrag = new combofrag();
int fragdata = combofinalist.get(i);
c.putInt("combonum", fragdata);
c.putInt("editable", 1);
combofrag.setArguments(c);
ft.replace(combolayouts[y], combofrag, "combo" + y);
y = y + 1;
ft.commit();
}