Changing screens

Hey. I´m new to LVGL. And I want to change the screen if I press a button, because I want to make a menu.
So I started to read the doc and tryed something out but i wont work.
Can somebody help me? I dont know what to change.

#include "Arduino_H7_Video.h"
#include "Arduino_GigaDisplayTouch.h"

#include "lvgl.h"

Arduino_H7_Video          Display(800, 480, GigaDisplayShield); /* Arduino_H7_Video Display(1024, 768, USBCVideo); */
Arduino_GigaDisplayTouch  TouchDetector;

lv_obj_t * screen1 = lv_obj_create(NULL);
lv_obj_t * screen2 = lv_obj_create(NULL);

static void btn1_event(lv_event_t * e) //event für btn1
  lv_event_code_t code = lv_event_get_code(e);
  lv_obj_t * btn1 = lv_event_get_target(e);
  if(code == LV_EVENT_CLICKED) {
    lv_scr_load(screen2); //aktiviert screen2

static void btn2_event(lv_event_t * e) //event für btn2
  lv_event_code_t code = lv_event_get_code(e);
  lv_obj_t * btn2 = lv_event_get_target(e);
  if(code == LV_EVENT_CLICKED) {
    lv_scr_load(screen1); //activates screen1

void screen1_struc (void){
  lv_obj_t * btn1 = lv_btn_create(screen1); 
  lv_obj_set_pos(btn1, 10, 10);                            /*Set its position*/
  lv_obj_set_size(btn1, 120, 50);                          /*Set its size*/
  lv_obj_add_event_cb(btn1, btn1_event, LV_EVENT_ALL, NULL);           /*Assign a callback to the button*/

void screen2_struc (void){
  lv_obj_t * btn2 = lv_btn_create(screen2); 
  lv_obj_set_pos(btn2, 50, 50);                            /*Set its position*/
  lv_obj_set_size(btn2, 190, 70);                          /*Set its size*/
  lv_obj_add_event_cb(btn2, btn2_event, LV_EVENT_ALL, NULL);           /*Assign a callback to the button*/


void setup() {


void loop() {


at first glance, everything is in order, unless you consider that lv_obj_create() should be called inside the function. what does not work?