Answer the question
In order to leave comments, you need to log in
What causes the application to freeze when working with fragments?
Good afternoon. What we do: at the start of the activity, add a fragment
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
switch (c) {
case (0):
fragmentTransaction.add(R.id.frame, new Fragment1());
break;
case (1):
fragmentTransaction.add(R.id.frame, new Fragment2());
break;
case (2):
fragmentTransaction.add(R.id.frame, new Fragment3());
break;
}
fragmentTransaction.commit();
public void getNextString() {
int i = new Random().nextInt(3);
while (resultsMassive[getNumString()][i+1] != null) {
i = new Random().nextInt(3);
}
c = i;
}
public void replaceFragment() {
if (variantsModelData.getTrainingList().size() > 0) {
setResults();
getNextString();
variantsModelData.getTrainingList().remove(0);
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
switch (c) {
case (0):
fragmentTransaction.replace(R.id.frame, new Fragment1());
break;
case (1):
fragmentTransaction.replace(R.id.frame, new Fragment2());
break;
case (2):
fragmentTransaction.replace(R.id.frame, new Fragment3());
break;
}
fragmentTransaction.commit();
} else {
resultsShow();
}
}
private int getNumString() {
for (int i = 0; i < resultsMassive.length; i++) {
if (resultsMassive[i][0] == variantsModelData.getTrainingList().get(0).get(0)) {
return i;
}
}
return 0;
}
public void setResults() {
resultsMassive[getNumString()][c + 1] = variantsModelData.isWin;
}
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
I/chatty: uid=10525(com.xxx.yyy) HeapTaskDaemon identical 3 lines
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
D/: [ZeroHung]zrhung_send_event: wp=257, ret=-1
E/ZrHungImpl: sendAppFreezeEvent failed!
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
I/chatty: uid=10525(com.xxx.yyy) HeapTaskDaemon identical 3 lines
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
I/chatty: uid=10525(com.xxx.yyy) HeapTaskDaemon identical 2 lines
E/: [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
D/: [ZeroHung]zrhung_send_event: wp=258, ret=-1
E/ZrHungImpl: sendAppFreezeEvent failed!
Background concurrent copying GC freed 439209(8MB) AllocSpace objects, 0(0B) LOS objects, X% free, 7MB/14MB, paused 1.579ms total 119.148ms
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question