- Create a new android project in Eclipse
- Create two (as many as you like) activities in Eclipse:
- Right click the Package Exporer, New > Other, or press Ctrl + N;
- Select Android Activity, name it Tabpage1 and Tabpage2
- Create a new Activity as the MainActivity, make sure it extends from TabActivity, instead of Activity.
- In MainActivity’s onCreate() function, add below code:
- Build and run, that is it.