After wrapping an app, super.onResume() of wrapping class, why is it not called?

A

AC Question

After wrapping an app, super.onResume() of wrapping class not called.

Issue only on L device. On other devices the app works fine.

After wrapping an app, we extend an existing activity with a wrapping activity.
Now lets say the existing activity has onResume overridden and calls super.onResume (duh!).
Without wrapping the app (i.e without extending it to wrapping activity) the app works fine. But if i run the app after wrapping, the wrapping activity's onResume is not getting called. (ExistingActivity extends WrappingActivity, so a super call in ExistingActivity should call onResume of WrappingActivity.)

Here is the weird part, if i put a debugger on, everything works as expected.

Some tests i tried:
1. Removed super.onResume from ExistingActivity. App crashes on start, as expected.
2. Removed super.onResume from WrappingActivity, app does not crash whereas it should have. So super method is not called. Now i put a debugger on, now the app crashes as expected.
3. Tried building hierarchies of classes. A extends B, B extends C, C extends WrappingActivity. super.onResume is called for A,B,C but not for WrappingActivity.
4. If i dont override onResume in the ExistingActivity, then the onResume of WrappingActivity is getting called correctly.
5. Checked at runtime that the super class for ExistingActivity is indeed WrappingActivity.
6. Observation : Any overridden method in the ExistingActivity class does not respect super method call to WrappingActivity. If i remove the overriding method in ExistingActivity then corresponding methods in WrappingActivity are correctly called.

Any ideas around this weird issue is greatly appreciated.
Thanks.
 

srkmagnus

Retired Moderator
May 23, 2010
13,434
210
0
Visit site
Re: After wrapping an app, super.onResume() of wrapping class not called.

Issue only on L device. On other devices the app works fine.

After wrapping an app, we extend an existing activity with a wrapping activity.
Now lets say the existing activity has onResume overridden and calls super.onResume (duh!).
Without wrapping the app (i.e without extending it to wrapping activity) the app works fine. But if i run the app after wrapping, the wrapping activity's onResume is not getting called. (ExistingActivity extends WrappingActivity, so a super call in ExistingActivity should call onResume of WrappingActivity.)

Here is the weird part, if i put a debugger on, everything works as expected.

Some tests i tried:
1. Removed super.onResume from ExistingActivity. App crashes on start, as expected.
2. Removed super.onResume from WrappingActivity, app does not crash whereas it should have. So super method is not called. Now i put a debugger on, now the app crashes as expected.
3. Tried building hierarchies of classes. A extends B, B extends C, C extends WrappingActivity. super.onResume is called for A,B,C but not for WrappingActivity.
4. If i dont override onResume in the ExistingActivity, then the onResume of WrappingActivity is getting called correctly.
5. Checked at runtime that the super class for ExistingActivity is indeed WrappingActivity.
6. Observation : Any overridden method in the ExistingActivity class does not respect super method call to WrappingActivity. If i remove the overriding method in ExistingActivity then corresponding methods in WrappingActivity are correctly called.

Any ideas around this weird issue is greatly appreciated.
Thanks.
Have you taken a look at the new documentation for developing with Lollipop support: http://developer.android.com/about/versions/lollipop.html
 

Forum statistics

Threads
943,171
Messages
6,917,629
Members
3,158,860
Latest member
smokedog87