Fixed missing fragment on tablets after rotation
This commit is contained in:
parent
0a1f2370a1
commit
7a539b6496
3 changed files with 15 additions and 2 deletions
|
@ -77,7 +77,6 @@
|
|||
|
||||
<LinearLayout
|
||||
android:id="@+id/fragmentContainer2"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
|
|
|
@ -77,7 +77,6 @@
|
|||
|
||||
<LinearLayout
|
||||
android:id="@+id/fragmentContainer2"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
|
|
|
@ -200,6 +200,8 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
currentFragment = nextFragment = FragmentsAvailable.EMPTY;
|
||||
if (savedInstanceState == null) {
|
||||
changeCurrentFragment(FragmentsAvailable.DIALER, getIntent().getExtras());
|
||||
} else {
|
||||
currentFragment = (FragmentsAvailable) savedInstanceState.getSerializable("currentFragment");
|
||||
}
|
||||
|
||||
mListener = new LinphoneCoreListenerBase(){
|
||||
|
@ -1285,6 +1287,12 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
outState.putSerializable("currentFragment", currentFragment);
|
||||
super.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
@ -1298,6 +1306,13 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
lc.addListener(mListener);
|
||||
}
|
||||
|
||||
if (isTablet()) {
|
||||
LinearLayout ll = (LinearLayout) findViewById(R.id.fragmentContainer2);
|
||||
if (currentFragment == FragmentsAvailable.DIALER) {
|
||||
ll.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
refreshAccounts();
|
||||
|
||||
updateMissedChatCount();
|
||||
|
|
Loading…
Reference in a new issue