So far I have used TabHost for my application to create 3 tabs. Each tab is represented by Office, in which I get the layout through setContentView(R.layout.something) from an XML file. So, 3 tabs, 3 actions and 3 XML files.
Now I came across fragments that are a new and better way, so here is my question.
Fragments process the user interface, so create 3 fragments that are processed by the FragmentPagerAdapter . Inside each fragment, I create content through XML files.
But where do I put all the code about which button does what it reads from the database or writes to it, etc. So far, they have all been in every Activity uploaded by TabHost .
I put all this code in onCreate() methods, etc. for each fragment or is there a better and cleaner way to do this?
source share