Skip to content

Commit

Permalink
LIBbb20831 Singleton DialogManager break the library #6 #5
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderLS committed Aug 31, 2018
1 parent bf72217 commit dd76360
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

public class DefaultDialogManager implements DialogManager {
private static volatile Reference<DefaultDialogManager> singleton = null;
private final Context context;
private Context context = null;
private final DialogOptions dialogOptions;
private final StoreOptions storeOptions;
private final OnClickButtonListener listener;
Expand Down Expand Up @@ -225,6 +225,10 @@ protected DefaultDialogManager(final Context context, final DialogOptions dialog
this.listener = dialogOptions.getListener();
}

private void setContext(Context context){
this.context = context;
}

/**
* Create rate dialog.
*
Expand Down Expand Up @@ -310,6 +314,8 @@ public DialogManager createDialogManager(final Context context, final DialogOpti
singleton = new WeakReference<>(new DefaultDialogManager(context, dialogOptions, storeOptions));
}
}
} else {
singleton.get().setContext(context);
}
return singleton.get();
}
Expand Down

0 comments on commit dd76360

Please sign in to comment.