// From TabListener @Override public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { // Create Fragment SampleFragment fragment = new SampleFragment(); // Set title for display purposes Bundle b = new Bundle(); b.putString(EXTRA_TITLE, tab.getText().toString()); fragment.setArguments(b); ft.replace(R.id.ptr_fragment, fragment); }
@Override public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) { // Launch signUp Activity if (tab.getText().equals(getResources().getString(R.string.signup))) { Log.d("MainActivity", "SingUp: Setting Intent..."); Intent intent = new Intent(); intent.setClass(MainActivitySeTIChat.this, SeTIChatSignUpActivity.class); startActivity(intent); } // When the given tab is selected, show the tab contents in the // container view. ContactsFragment fragment = new ContactsFragment(); getFragmentManager().beginTransaction().replace(R.id.container, fragment).commit(); }
@Override public CharSequence getText() { return mNativeTab.getText(); }