From 5fad89527ddad19f2278d44d786c1c0deab7d142 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Thu, 10 Aug 2017 01:10:15 -0500 Subject: [PATCH] ProfileList: Fix state tracking Signed-off-by: Jason A. Donenfeld --- .../java/com/wireguard/android/ProfileListActivity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/wireguard/android/ProfileListActivity.java b/app/src/main/java/com/wireguard/android/ProfileListActivity.java index 1e344060..31f845c2 100644 --- a/app/src/main/java/com/wireguard/android/ProfileListActivity.java +++ b/app/src/main/java/com/wireguard/android/ProfileListActivity.java @@ -58,8 +58,10 @@ public class ProfileListActivity extends ProfileActivity { } public void onProfileSelected(String profile) { - setIsEditing(false); if (isSplitLayout) { + if (isEditing()) + getFragmentManager().popBackStack(); + setIsEditing(false); updateLayout(profile); setCurrentProfile(profile); } else if (profile != null) { @@ -85,8 +87,6 @@ public class ProfileListActivity extends ProfileActivity { public void updateLayout(String profile) { final Fragment fragment = getFragmentManager().findFragmentById(R.id.fragment_container); - if (isEditing() && profile == null) - throw new IllegalStateException(); if (isEditing()) { if (fragment instanceof ProfileEditFragment) { final ProfileEditFragment editFragment = (ProfileEditFragment) fragment;