Prevent user from going back to group chat info once chat room has been created using back button so it doesn't create multiple rooms

This commit is contained in:
Sylvain Berfini 2018-03-08 12:53:28 +01:00
parent 7657660730
commit 2eef6369bf

View file

@ -204,6 +204,9 @@ public class GroupInfoFragment extends Fragment implements ChatRoomListener {
public void onStateChanged(ChatRoom cr, ChatRoom.State newState) { public void onStateChanged(ChatRoom cr, ChatRoom.State newState) {
if (newState == ChatRoom.State.Created) { if (newState == ChatRoom.State.Created) {
mWaitLayout.setVisibility(View.GONE); mWaitLayout.setVisibility(View.GONE);
// This will remove both the creation fragment and the group info fragment from the back stack
getFragmentManager().popBackStack();
getFragmentManager().popBackStack();
LinphoneActivity.instance().goToChat(cr.getPeerAddress().asStringUriOnly()); LinphoneActivity.instance().goToChat(cr.getPeerAddress().asStringUriOnly());
} else if (newState == ChatRoom.State.CreationFailed) { } else if (newState == ChatRoom.State.CreationFailed) {
mWaitLayout.setVisibility(View.GONE); mWaitLayout.setVisibility(View.GONE);