Unable to close the application when using no internet screen

I had made an application using web view and then I had added no internet screen. When network is disconnected it will show no internet screen and pressing back on that screen will close the app and I had made the same logic for the main screen when in home page pressing back will close the app, but in a rare case when using the application if network disconnected it shows no internet and reconnect again it shows the web view but, pressing back in home page will show no internet screen instead of closing the application.

Make sure to switch screens correctly


Here is my block logic




There you go… you do not switch screens correctly …
You should do it like this