I created a project using Eclipse Juno with ADT selecting the swipe+tab model for ICS version. I see in the generated code that there is a section that creates a textview and places the page/tab number in the center of the textview presented at runtime.
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Create a new TextView and set its text to the fragment's section
// number argument value.
TextView textView = new TextView(getActivity());
textView.setGravity(Gravity.CENTER);
textView.setText(Integer.toString(getArguments().getInt(ARG_SECTION_NUMBER)));
return textView;
However, instead of presenting a textview on each tab, I would like to present an XML file from my Layouts… a unique layout for each tab. I think I need to use something like this:
setContentView(R.layout.tab1);
OR
setContentView(R.layout.tab2);
But I cannot seem to figure out how to get this to work in my tabs. Advice?
Figured out how to present my XML Layout file (main.xml) in one of the tabs by using this code:
Hope this helps you too!