Opening another screen AND closing the current one

On most modern phones this is not necessary. Back in the day when an app was limited to 8 megabytes, closing a screen while opening another made some sense if the screens were memory intensive (e.g., many images). But realistically, most screens do not need that much memory, and phones these days have many GBs of RAM, not MBs. Both platforms typically represent screens as a stack of items. On Android, it is a stack of Activity objects and on iOS it is a stack of UIViewController objects. Users can move backward through the stack using the platform's corresponding back gesture/button, similar to how one would move backward through one's browsing history. By closing the screen you are leaving while opening a new screen, you are breaking this flow. App Inventor's open/close blocks assume the stack exists and can break in interesting ways, especially where the semantics of Screen1 (the root of your app) are concerned. I had to implement a bunch of hacks in the iOS version to work around this poorly presumed idea that closing the current screen was best practice and I would recommend against it unless your app is super memory intensive (In which case, why do you have so many memory intensive screens in your app? That sounds like a need to refactor/redesign).

1 Like