From 58f4ae104c189cdf258bfb05e3795fbca8dac2cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Mon, 22 Dec 2014 12:10:01 +0100 Subject: Revert deb2cfd & avoid arguments if previous fragment != null --- app/src/main/java/se/leap/bitmaskclient/Dashboard.java | 4 ++-- app/src/main/java/se/leap/bitmaskclient/SessionDialog.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java index e32dbdee..52b22695 100644 --- a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java +++ b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java @@ -329,7 +329,7 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn FragmentTransaction transaction = fragment_manager.removePreviousFragment(SessionDialog.TAG); DialogFragment newFragment = SessionDialog.newInstance(); - if(resultData != null && !resultData.isEmpty()) + if(resultData != null && !resultData.isEmpty() && fragment_manager.findFragmentByTag(SessionDialog.TAG) == null) newFragment.setArguments(resultData); newFragment.show(transaction, SessionDialog.TAG); } @@ -378,7 +378,7 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn FragmentTransaction transaction = fragment_manager.removePreviousFragment(SessionDialog.TAG); DialogFragment newFragment = SessionDialog.newInstance(); - if(resultData != null && !resultData.isEmpty()) { + if(resultData != null && !resultData.isEmpty() && fragment_manager.findFragmentByTag(SessionDialog.TAG) == null) { newFragment.setArguments(resultData); } newFragment.show(transaction, SessionDialog.TAG); diff --git a/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java b/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java index a8226d30..fd9ca851 100644 --- a/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java +++ b/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java @@ -133,8 +133,8 @@ public class SessionDialog extends DialogFragment{ * @return a new instance of this DialogFragment. */ public static DialogFragment newInstance() { - if(dialog == null || dialog.getArguments() != null) - dialog = new SessionDialog(); + if(dialog == null) + dialog = new SessionDialog(); return dialog; } -- cgit v1.2.3