1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-16 12:11:39 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

fix reload

This commit is contained in:
sunny.luo
2025-01-15 17:29:39 +08:00
parent a0adf1e778
commit 64b77d1b66

View File

@@ -150,14 +150,17 @@ public class UpdateModuleImpl {
if (getReactDelegateMethod != null) {
ReactDelegate reactDelegate = (ReactDelegate)
getReactDelegateMethod.invoke(currentActivity);
reactDelegate.reload();
// Try to get reload method using reflection
java.lang.reflect.Method reloadMethod =
ReactDelegate.class.getMethod("reload");
if (reloadMethod != null) {
reloadMethod.invoke(reactDelegate);
} else {
currentActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
currentActivity.recreate();
throw new NoSuchMethodException();
}
});
} else {
throw new NoSuchMethodException();
}
} catch (Throwable e) {
currentActivity.runOnUiThread(new Runnable() {