I am working on a project where I have multiple tabs, and I want the content of each tab to be set dynamically based on what is selected in the previous tab. (For my tabs, I am using the SlidingTabLayout with a ViewPager). I currently have my first tab set up correctly and have it tied to an EventBus that creates a LinearLayout based off of my template from R.layouts.tab_2 and adds the content dynamically. What I can't quite figure out is how to save my LinearLayout back into the tab_2.xml file. I have seen suggestions of saving it with SharedPreferences, but that doesn't allow me to save it as the right file type.
If there is a much easier way to do this, such as updating the tab that is already created, I am open to that instead of saving the layout back into the XML file. I am fairly new at programming in Android Studio and still trying to get the basics down.
Aucun commentaire:
Enregistrer un commentaire