File tree 1 file changed +14
-10
lines changed
ReactAndroid/src/main/java/com/facebook/react/bridge
1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -141,16 +141,20 @@ public void addLifecycleEventListener(final LifecycleEventListener listener) {
141
141
case BEFORE_RESUME :
142
142
break ;
143
143
case RESUMED :
144
- runOnUiQueueThread (new Runnable () {
145
- @ Override
146
- public void run () {
147
- try {
148
- listener .onHostResume ();
149
- } catch (RuntimeException e ) {
150
- handleException (e );
151
- }
152
- }
153
- });
144
+ runOnUiQueueThread (
145
+ new Runnable () {
146
+ @ Override
147
+ public void run () {
148
+ if (!mLifecycleEventListeners .contains (listener )) {
149
+ return ;
150
+ }
151
+ try {
152
+ listener .onHostResume ();
153
+ } catch (RuntimeException e ) {
154
+ handleException (e );
155
+ }
156
+ }
157
+ });
154
158
break ;
155
159
default :
156
160
throw new RuntimeException ("Unhandled lifecycle state." );
You can’t perform that action at this time.
0 commit comments