mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-06-16 19:51:57 +08:00
Fixed app crash caused by BadTokenException. (#1287)
This commit is contained in:
committed by
Alexander Goncharov
parent
163e2b5b8d
commit
21f8388f6a
@@ -20,7 +20,7 @@ public class CodePushDialog extends ReactContextBaseJavaModule{
|
||||
public void showDialog(final String title, final String message, final String button1Text,
|
||||
final String button2Text, final Callback successCallback, Callback errorCallback) {
|
||||
Activity currentActivity = getCurrentActivity();
|
||||
if (currentActivity == null) {
|
||||
if (currentActivity == null || currentActivity.isFinishing()) {
|
||||
// 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() {
|
||||
|
||||
Reference in New Issue
Block a user