AndroidActivityCallbacks onPause/onResume


I’m following this guide for extending Activity:

Why are onPause and onResume not included in AndroidActivityCallbacks? My application.on(application.suspendEvent, ...) and application.on(application.resumeEvent, ...) calls no longer work now.



They are included but under a slightly different name, you can use these following activity callbacks within your ngOnInit():, () => { });, () => { });, () => { });```


I am experiencing the same issues as the OP. While your solution works for Android, it doesn’t work for iOS. Is there a way in making it compatible for both platforms? Using application.on(application.lowMemoryEvent, __) no longer runs


i doubt it, the events used are android events, not ios events


Do you know why the application events are no longer working when we extend the activity?

Doesn’t seem good to have both android specific events ( in addition to the platform independent event provided by nativescript (application.on(application.suspendEvent).


Are you following the instructions here while extending the activity? You will have to trigger callbacks form your extended activity using . _callbacks object.


Yes, my is a duplicate of the docs. The moment I added this, my application events stopped working, but it will work if I use the activity callbacks mast3rd3mon mentioned.


That’s the right way of doing and just the same described in docs. Android activity life cycle events are under android name space only as it won’t be valid in iOS.