mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-11-03 23:03:11 +08:00
解决某些情况下android不能重启的问题
This commit is contained in:
@@ -135,13 +135,12 @@ public class UpdateModule extends ReactContextBaseJavaModule{
|
|||||||
loadField.set(instanceManager, loader);
|
loadField.set(instanceManager, loader);
|
||||||
}
|
}
|
||||||
|
|
||||||
final Method recreateMethod = instanceManager.getClass().getMethod("recreateReactContextInBackground");
|
try {
|
||||||
|
instanceManager.recreateReactContextInBackground();
|
||||||
|
} catch(Throwable err) {
|
||||||
|
activity.recreate();
|
||||||
|
}
|
||||||
|
|
||||||
final ReactInstanceManager finalizedInstanceManager = instanceManager;
|
|
||||||
|
|
||||||
recreateMethod.invoke(finalizedInstanceManager);
|
|
||||||
|
|
||||||
activity.recreate();
|
|
||||||
} catch (Throwable err) {
|
} catch (Throwable err) {
|
||||||
Log.e("pushy", "Failed to restart application", err);
|
Log.e("pushy", "Failed to restart application", err);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user