How to save the data written in a text area if you change page

Hello, I have three multiple pages in my project.
If for example we have three pages A and B. Page A contains text areas with a button that allows me to go to page B. Page B contains a button that allows me to return to page A. With my project, when I put data in page A, when I click on the button to go to page B it works. But when I come back to page A, the data erases.
I will want to know how to maintain the data of page A.
thank you for helping me

Hi

Each page needs to be in an object. Then you just show / hide whatever object you want.

Hi, thanks for responding. What is the function to show and hide data.

lv_obj_set_hidden( [obj], true/fasle)

Here is my code, when I click on the SAVE THE SETTING button, the first page (First_Screen) is displayed. But when I come back to the second page (Second_Screen), the value I put in the text erea clears.

static void First_Screen(void)
{
fen_deux = lv_obj_create(lv_scr_act(), NULL);
lv_obj_set_size(fen_deux, 480, 320);

lv_obj_t * btn_3 = lv_btn_create(fen_deux, NULL);
lv_obj_set_pos(btn_3, 150, 40);
lv_obj_set_size(btn_3, 180, 30);
lv_obj_t * label_3 = lv_label_create(btn_3, NULL);
lv_label_set_text(label_3, "SETTING");
lv_obj_set_event_cb(btn_3, event_handler_parametre);
}

static void kb_event_cb(lv_obj_t * keyboard, lv_event_t e)
{
lv_keyboard_def_event_cb(kb, e);
if(e == LV_EVENT_CANCEL) {
lv_keyboard_set_textarea(kb, NULL);
}
}

static void event_handler_Second_Screen(lv_obj_t *obj, lv_event_t e)
{
if(e == LV_EVENT_CLICKED){

fen_trois = lv_obj_create(NULL, NULL);
lv_obj_set_size(fen_trois, 480, 320);

lv_obj_t * tab = lv_tabview_create (fen_trois, NULL );
lv_obj_set_size (tab, LV_HOR_RES, LV_VER_RES);

tab1 = lv_tabview_add_tab(tab, " BALAYAGE ");

lv_obj_t * ta_1 = lv_textarea_create(tab1, NULL);
lv_textarea_set_text(ta_1, "");
lv_textarea_set_one_line(ta_1, true);
lv_textarea_set_cursor_hidden(ta_1, true);
lv_obj_set_width(ta_1, LV_HOR_RES / 2 - 20);
lv_obj_set_size(ta_1, 100, 30);
lv_obj_set_pos(ta_1, 10, 30);
lv_obj_set_hidden (ta_1, false);
lv_obj_set_event_cb(ta_1, ta_event_cb);

/* Create a label and position it above the text box */
lv_obj_t * labe_11 = lv_label_create(tab1, NULL);
lv_label_set_text(labe_11, "DEMARRAGE:");
lv_obj_align(labe_11, ta_1, LV_ALIGN_OUT_TOP_LEFT, 0, 0);


/* Create a keyboard */
kb = lv_keyboard_create(tab1, NULL);
lv_keyboard_set_cursor_manage(kb, true);
lv_obj_set_event_cb(kb, kb_event_cb);
lv_obj_set_size(kb,  LV_HOR_RES, LV_VER_RES / 4);
lv_keyboard_set_mode(kb, LV_KEYBOARD_MODE_NUM);
lv_keyboard_set_textarea(kb, ta_1);


lv_obj_t * btn_16 = lv_btn_create(tab1, NULL);
lv_obj_set_pos(btn_16, 10, 70);
lv_obj_set_size(btn_16, 440, 50);
lv_obj_t * label_16 = lv_label_create(btn_16, NULL);
lv_label_set_text(label_16, "SAVE THE SETTING");
lv_obj_set_event_cb(btn_16, event_handler_retour_fen_deux_param);


lv_scr_load ( fen_trois );

}

}

static void event_handler_retour_First_Screen(lv_obj_t *obj, lv_event_t event)
{
if(event == LV_EVENT_CLICKED){

lv_scr_load ( fen_deux );

}
}

static void ta_event_cb(lv_obj_t * ta_1, lv_event_t event)
{
if(event == LV_EVENT_CLICKED) {
if(kb != NULL)
lv_keyboard_set_textarea(kb, ta_1);
}
else if(event == LV_EVENT_INSERT) {
const char * str = lv_event_get_data();
if(str[0] == ‘\n’) {
printf(“Ready\n”);
}
}
}

If you delete the text area it will lose its contents. To keep the content you will either need to show and hide it, or call lv_textarea_get_text.