Problem with listviewer

Hi I’m working on an app that will serve as a relay for an alarm clock.
my problem is when I create a list and switch to another screen and then come back the list has disappeared

here the first screen

here the second screen

i can’t put more than tree pic cause I’m a new user sry

thx for answer me <3

1 Like

I would also like to know how to maintain the state of one screen, as I am trying to create a second screen for debug purposes.

How about using a stored variable instead?

Domhnall, The issue is the entire state of the screen. Images API calls etc. What you would need to do is store everything in variables, and then when you slide back you have to reinstate all images and labels with the content of the variables.

Not ideal.

For example on the app I am working on I have 13 objects with content. A retain state of screen would be a nice feature.


Unless you’re making new HTTP requests each time the screen loads then it should be pretty much instantaneous, no?

I think having a “retain state” method would end up creating memory-hungry apps and we’d start to see crashes.

Beir bua!

Sure the results are instantaneous but now you have to manage two instances of each screen. Every time you make a change on one screen you need to build a process to reinstate that variable etc etc. This could be an automated feature. Return to Previous State. Creates an automatic cache of the screen.

I was trying to use a second screen to debug, and it turns out to be too problematic.

Is there a way to scroll down if you make a large label?

Míle buíochas

in general it will be necessary to store the lists in a variable and put it for example in the block “when screen start”?

In the short term, if your app design allows for it, I might suggest placing your screens within a Tab or Drawer navigator. I believe that in those cases the state of the screens will be automatically maintained.

The problem with “plain” screens is that plain screens are placed in a default (and implicit) Stack Navigator and that the 'navigate to' block currently creates a new version of the screen that you are navigating to when your screens are within a Stack Navigator. We need to create a way to allow you to specify when you want to navigate to an already existing screen when using a Stack Navigator.


1 Like