How to check which window within the app came up?

Hן,

I do automation testing for my application (APPIUM for Android) . There is a situation in which in response to click on a button the Application can load 2 different windows (depending if here is WiFi or not). How do I as a response to a button click checker Which of the two windows appear ? Each window has a message with a message and a few text boxes for entering details.

thanks !

We are the page/screen object model. We have a large number of windows/screens with our application, so we built a screen factory to detect the screen and instantiate a screen object of that type. We recognize the screen type based on the android activity and visible elements on the screen, such as resource-ids or visible text.