From d0f0b317c200787219556674c46fb397e90b6ffc Mon Sep 17 00:00:00 2001 From: litao Date: Mon, 15 Jan 2018 19:36:20 +0800 Subject: [PATCH] remove singleton --- .../lib/NiftyDialogBuilder.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/library/src/main/java/com/gitonway/lee/niftymodaldialogeffects/lib/NiftyDialogBuilder.java b/library/src/main/java/com/gitonway/lee/niftymodaldialogeffects/lib/NiftyDialogBuilder.java index 3932ae1..53097ac 100644 --- a/library/src/main/java/com/gitonway/lee/niftymodaldialogeffects/lib/NiftyDialogBuilder.java +++ b/library/src/main/java/com/gitonway/lee/niftymodaldialogeffects/lib/NiftyDialogBuilder.java @@ -106,15 +106,7 @@ protected void onCreate(Bundle savedInstanceState) { public static NiftyDialogBuilder getInstance(Context context) { - if (instance == null || !tmpContext.equals(context)) { - synchronized (NiftyDialogBuilder.class) { - if (instance == null || !tmpContext.equals(context)) { - instance = new NiftyDialogBuilder(context, R.style.dialog_untran); - } - } - } - tmpContext = context; - return instance; + return new NiftyDialogBuilder(context, R.style.dialog_untran); }