コード例 #1
0
  // 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);
  }
コード例 #2
0
  @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();
  }
コード例 #3
0
 @Override
 public CharSequence getText() {
   return mNativeTab.getText();
 }