下面我有三个标签,每个标签都会带你去一个活动
- 点击
Rating
- - - >MainActivity.class
- 点击
Price
- - - >PriceDescriptionActivity.class
- 点击
Distance
- - - >DistanceDiscriptionActivity.class
我怎样才能做到这一点::
点击
Rating
- - - >MainActivity.class
第二次点击
Rating
--->PriceDescriptionActivity.class
- 第三次点击
Rating
--->MainActivity.class
AndroidTabRestaurantDescListView.java
public class AndroidTabRestaurantDescListView extends TabActivity {
// TabSpec Names
private static final String INBOX_SPEC = "Rating";
private static final String OUTBOX_SPEC = "Price";
private static final String PROFILE_SPEC = "Distance";
Button Photos;
Button Filter;
Button Search;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Photos=(Button) findViewById(R.id.PhotoButton);
Filter=(Button) findViewById(R.id.FilterButton);
Search=(Button) findViewById(R.id.SearchBottomBarID);
TabHost tabHost = getTabHost();
// Inbox Tab
TabSpec inboxSpec = tabHost.newTabSpec(INBOX_SPEC);
Intent inboxIntent = new Intent(this, MainActivity.class);
inboxSpec.setIndicator(INBOX_SPEC);
// Tab Content
inboxSpec.setContent(inboxIntent);
// Outbox Tab
TabSpec PriceSpec = tabHost.newTabSpec(OUTBOX_SPEC);
Intent PriceIntent = new Intent(this, PriceDescriptionActivity.class);
PriceSpec .setIndicator(OUTBOX_SPEC);
PriceSpec.setContent(PriceIntent);
// Profile Tab
TabSpec DistanceSpec = tabHost.newTabSpec(PROFILE_SPEC);
Intent DistanceIntent = new Intent(this, DistanceDiscriptionActivity.class);
DistanceSpec .setIndicator(PROFILE_SPEC);
DistanceSpec.setContent(DistanceIntent);
// Adding all TabSpec to TabHost
tabHost.addTab(inboxSpec);
tabHost.addTab(PriceSpec);
tabHost.addTab(DistanceSpec);
//Set the current value tab to default first tab
tabHost.setCurrentTab(0);
}
}
说我不想使用片段或自定义按钮....我怎样才能在这里实现
可能吗
如果可能的话-----我应该做些什么改变?