summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-12-22 12:10:01 +0100
committerParménides GV <parmegv@sdf.org>2014-12-22 12:10:01 +0100
commit58f4ae104c189cdf258bfb05e3795fbca8dac2cb (patch)
treebd505c296cad2a65241917306db8e233cac401aa
parentdeb2cfdeb174822e5550924ac1000f30d948c1cd (diff)
Revert deb2cfd & avoid arguments if previous fragment != null
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/Dashboard.java4
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/SessionDialog.java4
2 files changed, 4 insertions, 4 deletions
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;
}