Back to project page context-sms.
The source code is released under:
MIT License
If you think the Android project context-sms listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/** This class has been taken from http://examples.javacodegeeks.com/android/core/app/fragment/android-fragment-tabs-example/ * I used this tutorial to create tabbed fragments. *///from w w w.j a v a2 s . c o m package com.bretblack.wesay; import android.app.ActionBar.Tab; import android.app.Fragment; import android.app.FragmentTransaction; import android.app.ActionBar; public class TabListener implements ActionBar.TabListener { private Fragment fragment; // The contructor. public TabListener(Fragment fragment) { this.fragment = fragment; } // When a tab is tapped, the FragmentTransaction replaces // the content of our main layout with the specified fragment; // that's why we declared an id for the main layout. @Override public void onTabSelected(Tab tab, FragmentTransaction ft) { ft.replace(R.id.activity_main, fragment); } // When a tab is unselected, we have to hide it from the user's view. @Override public void onTabUnselected(Tab tab, FragmentTransaction ft) { ft.remove(fragment); } // Nothing special here. Fragments already did the job. @Override public void onTabReselected(Tab tab, FragmentTransaction ft) { } }