1. You can check whether the app is in the foreground with B4XPages.GetManager.IsForeground.
2. You can check which pages are in the stack with B4XPages.GetManager.mStackOfPageIds (it is a B4XSet that holds the pages ids).
3. You can check whether B4XPages was initialized with B4XPages.IsInitialized. This is relevant if there are cases where the app starts in the background, for example with push notifications.