Fix crash when going to history/contacts/chat on tablet
This commit is contained in:
parent
ec33a1366b
commit
0a1f2370a1
1 changed files with 13 additions and 11 deletions
|
@ -355,9 +355,6 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
switch (newFragmentType) {
|
switch (newFragmentType) {
|
||||||
case HISTORY_LIST:
|
case HISTORY_LIST:
|
||||||
fragment = new HistoryListFragment();
|
fragment = new HistoryListFragment();
|
||||||
if (isTablet()) {
|
|
||||||
((HistoryListFragment) fragment).displayFirstLog();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case HISTORY_DETAIL:
|
case HISTORY_DETAIL:
|
||||||
fragment = new HistoryDetailFragment();
|
fragment = new HistoryDetailFragment();
|
||||||
|
@ -365,15 +362,12 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
case CONTACTS_LIST:
|
case CONTACTS_LIST:
|
||||||
checkAndRequestReadContactsPermission();
|
checkAndRequestReadContactsPermission();
|
||||||
fragment = new ContactsListFragment();
|
fragment = new ContactsListFragment();
|
||||||
if (isTablet()) {
|
|
||||||
((ContactsListFragment) fragment).displayFirstContact();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case CONTACT_DETAIL:
|
case CONTACT_DETAIL:
|
||||||
fragment = new ContactDetailsFragment();
|
fragment = new ContactDetailsFragment();
|
||||||
break;
|
break;
|
||||||
case CONTACT_EDITOR:
|
case CONTACT_EDITOR:
|
||||||
fragment = new ContactEditorFragment();
|
fragment = new ContactEditorFragment();
|
||||||
break;
|
break;
|
||||||
case DIALER:
|
case DIALER:
|
||||||
fragment = new DialerFragment();
|
fragment = new DialerFragment();
|
||||||
|
@ -395,9 +389,6 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
break;
|
break;
|
||||||
case CHAT_LIST:
|
case CHAT_LIST:
|
||||||
fragment = new ChatListFragment();
|
fragment = new ChatListFragment();
|
||||||
if (isTablet()) {
|
|
||||||
((ChatListFragment) fragment).displayFirstChat();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case CHAT:
|
case CHAT:
|
||||||
fragment = new ChatFragment();
|
fragment = new ChatFragment();
|
||||||
|
@ -410,6 +401,17 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
fragment.setArguments(extras);
|
fragment.setArguments(extras);
|
||||||
if (isTablet()) {
|
if (isTablet()) {
|
||||||
changeFragmentForTablets(fragment, newFragmentType, withoutAnimation);
|
changeFragmentForTablets(fragment, newFragmentType, withoutAnimation);
|
||||||
|
switch (newFragmentType) {
|
||||||
|
case HISTORY_LIST:
|
||||||
|
((HistoryListFragment) fragment).displayFirstLog();
|
||||||
|
break;
|
||||||
|
case CONTACTS_LIST:
|
||||||
|
((ContactsListFragment) fragment).displayFirstContact();
|
||||||
|
break;
|
||||||
|
case CHAT_LIST:
|
||||||
|
((ChatListFragment) fragment).displayFirstChat();
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
changeFragment(fragment, newFragmentType, withoutAnimation);
|
changeFragment(fragment, newFragmentType, withoutAnimation);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue