Update CodePushDialog.java

This commit is contained in:
Geoffrey Goh
2016-07-28 14:40:47 -07:00
committed by GitHub
parent 20370fa3ca
commit 516f5cac64

View File

@@ -24,13 +24,10 @@ public class CodePushDialog extends ReactContextBaseJavaModule{
// If getCurrentActivity is null, it could be because the app is backgrounded,
// so we show the dialog when the app resumes)
getReactApplicationContext().addLifecycleEventListener(new LifecycleEventListener() {
private boolean shown = false;
@Override
public void onHostResume() {
Activity currentActivity = getCurrentActivity();
if (!shown && currentActivity != null) {
shown = true;
if (currentActivity != null) {
getReactApplicationContext().removeLifecycleEventListener(this);
showDialogInternal(title, message, button1Text, button2Text, successCallback, currentActivity);
}