onPause for every page

android

#1

Hello every one I want to know that is there any way that I can call access all the life cycle events on every page where i want.

let’s say I have 10 pages application now I am calling onPause method of Home page(First Page) in which I am unrestringing broadcast receiver. When I am on fourth page and application paused(phone locked) I am not able to access that BR.

I don’t want to re-register it onResume event. Someone please clear my doubt if I am doing wrong.


#2

I guess you are quite confused between the term Page (Fragments) and Activity. NativeScript runs on single activity, all your pages are part of same activity.

All life cycle events are part of Activity and not a Page which makes your job more simple, you don’t have to worry about adding / removing listeners on every page but just once upon app start.

I believe we discussed same in another thread?