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); fragmentsHistory.remove(fragmentsHistory.size() - 1);
FragmentsAvailable newFragmentType = fragmentsHistory.get(fragmentsHistory.size() - 1); if (fragmentsHistory.size() > 0) {
LinearLayout ll = (LinearLayout) findViewById(R.id.fragmentContainer2); FragmentsAvailable newFragmentType = fragmentsHistory.get(fragmentsHistory.size() - 1);
if (newFragmentType.shouldAddItselfToTheRightOf(currentFragment)) { LinearLayout ll = (LinearLayout) findViewById(R.id.fragmentContainer2);
ll.setVisibility(View.VISIBLE); if (newFragmentType.shouldAddItselfToTheRightOf(currentFragment)) {
} else { ll.setVisibility(View.VISIBLE);
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 { } 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);
}
} }
} }
} }