Screen change due to delete something

Using the screen switching function, objects and events written by oneself will disappear after switching screens. How to solve this problem

I guess you’re using temporary screens who delete themselves when another new screen is loaded. (With normal LVGL screens nothing is deleted in these cases, but they remain in memory.) If you need to stick to the use of temporary screens, the solution is to create CALL_FUNCTION event-actions on the ‘SCREEN_LOADED’ event-trigger of every screen, and create your extra hand-coded widgets inside those functions. Then every time the screen gets reloaded and recreated, your extra widgets/event-settings will get recreated along with it in the function. You can decide if you want to place and use the functions in ui_events.c, or if you use ‘don’t export’ flag on CALL_FUNCTION action, you’ll need to provide those functions externally.