cancel
Showing results for 
Search instead for 
Did you mean: 

Screen status resets to default when we transitioned to another screen and come back!

Mk.31
Associate III

Hi team,

I'm designing a multiple screens template in my application. I'm using a slider and a toggle button in one of my screen, I kept the slider invisible, and I linked to the toggle button.

when I change the state of the toggle button the slider has to appear and vice versa. now I'm changing the toggle button state (let's say ON) so now-slider will appear, after that I'm keeping the slider state halfway.

Now when I transitioned to another screen from this screen and coming back, at that time toggle button is in the OFF state and the slider is invisible (which is a default state) which shouldn't happen. Expecting to be in an updated state when I transition back.

how do I get the previous update state in the current screen when we switch back to the current screen from another screen.

current screen:

0693W000007ZOREQA4.jpg 

toggle-button pressed, the slider will appear, and setting the slider to half-way:

0693W000007ZOT0QAO.jpgtransitioned to another screen (co2 screen in this case):

0693W000007ZOTPQA4.jpgNow ill press the back button here and ill go to the original screen again, at this time the screen state has to be like image 2 but it is not it is resetting to default like:

0693W000007ZOUDQA4.jpg

1 REPLY 1
Alexandre RENOUX
Principal

Hello Mk.3,

Don't worry that is completely normal. In fact, only one screen at a time is allocated so when you switch to another screen the previous screen data is deleted so when you come back it will be reinitialized. To avoid loosing data you need to use the MVP architecture and save your data in the Model.

Please have a look at this tutorial.

When your question is answered, please close this topic by choosing Select as Best.

/Alexandre