I am in the process of creating an app with the following functionality. The Main activity is a Tabbed activity with three fragments
. The middle fragment
consists of a ListView
. When you select the listView item it will allow you to do one of two things:
- Edit the layout, you can add buttons, switches, text boxes, ect.
- If a layout is created, you can swipe to the first tab where the layout will be loaded with all the custom views the user added.
I would like to know how I can save each ViewGroup
so the user can access them and edit them as they please. I do not think this can be done with SavedStated because it will be across different activities, that is why I need a way to save/load them.
I have one fragment that allows you to customize the layout. I would like to only save the ViewGroup
with all the children. So instead of having 10 different XML layouts, you would have 1 XML
layout with 10 different ViewGroups that can be inserted dynamically as the different ListView
item is selected.
It cannot be an image of the layout, I need to have the functionality of all the buttons and switches when I tab over to the View and the user needs to be able to edit their layout when they please.