mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-18 01:26:10 +08:00
解决某些情况下android不能重启的问题
This commit is contained in:
@@ -135,13 +135,12 @@ public class UpdateModule extends ReactContextBaseJavaModule{
|
||||
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) {
|
||||
Log.e("pushy", "Failed to restart application", err);
|
||||
}
|
||||
|
Reference in New Issue
Block a user