2. Code
Go back to the main window and copy and paste the code from the CategoryPage tab to the SubcategoryPage tab. Change category into subcategory where needed. Clv2 becomes clv3 and btn2 becomes btn3.
Copy the methods B4XPage_Appear, B4XPage_Disappear, setup_dialog, load_list, save_list.
Note that the IDE will underline in red where there needs to be a change in the code.
The list will be saved in the “subcategory.txt” file.
Copy the code from btn2_Click in CategoryPage to btn3_Click in SubcategoryPage and adjust for subcategory. Don’t change the “category_dialog” string as we use the same layout as for category.
Copy the code from clv2_ItemClick in CategoryPage to clv3_ItemClick in SubcategoryPage and adjust for subcategory. Don’t change the “category_dialog” string as we use the same layout as for category.
The subcategory list should work now.