Back to project page Implementing-ActionBarSherlock-Fragment-Tabs-in-Android.
The source code is released under:
Apache License
If you think the Android project Implementing-ActionBarSherlock-Fragment-Tabs-in-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.sherlockfragmenttabs; /* ww w . j a v a 2s.co m*/ import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.ActionBar.Tab; import com.actionbarsherlock.app.SherlockFragment; public class FragmentsTab3 extends SherlockFragment implements ActionBar.TabListener { private Fragment mFragment; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Get the view from fragment3.xml getActivity().setContentView(R.layout.fragment3); } public void onTabSelected(Tab tab, FragmentTransaction ft) { // TODO Auto-generated method stub mFragment = new FragmentsTab3(); // Attach fragment3.xml layout ft.add(android.R.id.content, mFragment); ft.attach(mFragment); } public void onTabUnselected(Tab tab, FragmentTransaction ft) { // TODO Auto-generated method stub // Remove fragment3.xml layout ft.remove(mFragment); } public void onTabReselected(Tab tab, FragmentTransaction ft) { // TODO Auto-generated method stub } }