root/trunk/18.TabActivityTest/src/soo/elements/activity/TabActivityTest.java

리비전 44, 1.1 kB (mefour에 의해 체크인됨, 15 년 전)

--

Line 
1 package soo.elements.activity;
2
3 import android.app.TabActivity;
4 import android.content.Intent;
5 import android.os.Bundle;
6 import android.widget.TabHost;
7
8 public class TabActivityTest extends TabActivity {
9     /** Called when the activity is first created. */
10     @Override
11     public void onCreate(Bundle savedInstanceState) {
12         super.onCreate(savedInstanceState);
13         setContentView(R.layout.main);
14        
15         TabHost th = getTabHost();
16        
17         th.addTab(
18                 th.newTabSpec("TAB_TEST1")
19                 .setIndicator("TAB 1")
20                 .setContent(R.id.textView01)
21         );
22        
23         th.addTab(
24                 th.newTabSpec("TAB_TEST2")
25                 .setIndicator("TAB 2")
26                 .setContent(R.id.textView02)
27         );
28        
29         th.addTab(
30                 th.newTabSpec("TAB_TEST3")
31                 .setIndicator("TAB 3")
32                 .setContent(R.id.imageView01)
33             );
34        
35         th.addTab(
36                         th.newTabSpec("TAB_TEST4")
37                         .setIndicator("TAB 4")
38                         .setContent(new Intent(this,SubActivity.class))
39         );
40        
41         th.setCurrentTab(2);
42         //this.addTab("Tab_Test1").set
43     }
44 }
참고: 소스 브라우저를 사용하면서 도움이 필요하다면, TracBrowser를 참고하십시오.