コード例 #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_stations_all);
    ActionBar ab = getActionBar();
    ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    ActionBar.Tab listTab = ab.newTab().setText("List");
    ActionBar.Tab mapTab = ab.newTab().setText("Map");

    Fragment listFrag = new StationsListFragment();
    Fragment mapFrag = new InteractiveMapFragment();

    listTab.setTabListener(new StationsAllTabListener(listFrag));
    listTab.setTabListener(new StationsAllTabListener(listFrag));
    listTab.setTabListener(new StationsAllTabListener(listFrag));

    mapTab.setTabListener(new StationsAllTabListener(mapFrag));

    ab.addTab(listTab);
    ab.addTab(mapTab);

    listTab.select();
  }
コード例 #2
0
 @Override
 public void select() {
   mNativeTab.select();
 }