Skip to content

Commit

Permalink
fix reload
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny.luo committed Jan 15, 2025
1 parent a0adf1e commit 64b77d1
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,17 @@ public void run() {
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 {
throw new NoSuchMethodException();
}
} else {
currentActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
currentActivity.recreate();
}
});
throw new NoSuchMethodException();
}
} catch (Throwable e) {
currentActivity.runOnUiThread(new Runnable() {
Expand Down

0 comments on commit 64b77d1

Please sign in to comment.