Fix crash that happens sometimes

This commit is contained in:
Sylvain Berfini 2013-10-08 15:16:07 +02:00
parent 1f54b20397
commit b33f2fc103

View file

@ -1370,20 +1370,22 @@ public class LinphoneActivity extends FragmentActivity implements
}
fragmentsHistory.remove(fragmentsHistory.size() - 1);
FragmentsAvailable newFragmentType = fragmentsHistory.get(fragmentsHistory.size() - 1);
LinearLayout ll = (LinearLayout) findViewById(R.id.fragmentContainer2);
if (newFragmentType.shouldAddItselfToTheRightOf(currentFragment)) {
ll.setVisibility(View.VISIBLE);
} else {
if (newFragmentType == FragmentsAvailable.DIALER
|| newFragmentType == FragmentsAvailable.ABOUT
|| newFragmentType == FragmentsAvailable.ABOUT_INSTEAD_OF_CHAT
|| newFragmentType == FragmentsAvailable.ABOUT_INSTEAD_OF_SETTINGS
|| newFragmentType == FragmentsAvailable.SETTINGS
|| newFragmentType == FragmentsAvailable.ACCOUNT_SETTINGS) {
ll.setVisibility(View.GONE);
if (fragmentsHistory.size() > 0) {
FragmentsAvailable newFragmentType = fragmentsHistory.get(fragmentsHistory.size() - 1);
LinearLayout ll = (LinearLayout) findViewById(R.id.fragmentContainer2);
if (newFragmentType.shouldAddItselfToTheRightOf(currentFragment)) {
ll.setVisibility(View.VISIBLE);
} else {
ll.setVisibility(View.INVISIBLE);
if (newFragmentType == FragmentsAvailable.DIALER
|| newFragmentType == FragmentsAvailable.ABOUT
|| newFragmentType == FragmentsAvailable.ABOUT_INSTEAD_OF_CHAT
|| newFragmentType == FragmentsAvailable.ABOUT_INSTEAD_OF_SETTINGS
|| newFragmentType == FragmentsAvailable.SETTINGS
|| newFragmentType == FragmentsAvailable.ACCOUNT_SETTINGS) {
ll.setVisibility(View.GONE);
} else {
ll.setVisibility(View.INVISIBLE);
}
}
}
}