How to switch screens properly in if-else conditions
I want to switch screens based on the value in if-else condition
If the value is 1 I want change screen to test_screen1(); else change the screen to test_screen2();
When I try to change the screen the screen not displaying properly (some times unknown objects are creating at top left, some times the created objects are not showing on screen but when I touch on object created area the object is coming).
I am just calling screen functions. Did I missed anything while switching the screens?
And when I switch screens normally (changing screens on button click it works good)
Thanks in Advance.
What MCU/Processor/Board and compiler are you using?
What LVGL version are you using?
What do you want to achieve?
What have you tried so far?
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
/*You code here*/
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.