xxxxxxxxActivity .java:package com.fp.app.CmccWireless;import android.app.Activity;import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;public class xxxxxxxxActivity extends TabActivity implements TabHost.OnTabChangeListener{    private TabHost mTabHost;    @Override    public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          setContentView(R.layout.xxxxx);          mTabHost = getTabHost();        mTabHost.setOnTabChangedListener(this);        setupxxxx1Tab();        setupxxxx2Tab();        mTabHost.setCurrentTab(1);    }    private void setupxxxx1Tab() {        Intent intent = new Intent();        intent.setClass(this, xxxx1Activity.class);        mTabHost.addTab(mTabHost.newTabSpec("xxxx1")                .setIndicator("xxxx1",                        getResources().getDrawable(R.drawable.icon))                .setContent(intent));    }    private void setupxxxx2Tab() {        Intent intent = new Intent();        intent.setClass(this, xxxx2Activity.class);        mTabHost.addTab(mTabHost.newTabSpec("xxxx2")                .setIndicator("xxxx2",                        getResources().getDrawable(R.drawable.icon))                .setContent(intent));    }    public void onTabChanged(String tabId) {        Activity activity = getLocalActivityManager().getActivity(tabId);        if (activity != null) {            activity.onWindowFocusChanged(true);        }    }}xxxx1Activity.javapackage com.fp.app.CmccWireless;import android.app.Activity;import android.os.Bundle;public class c1_WirelessCityRecomActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          setContentView(R.layout.xxxx1);       }}xxxx2Activity.javapackage com.fp.app.CmccWireless;import android.app.Activity;import android.os.Bundle;public class c1_WirelessCityRecomActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          setContentView(R.layout.xxxx2);       }}layout/xxxx1.xml<?xml version="1.0" encoding="utf-8"?>    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"        android:layout_width="fill_parent"         android:layout_height="fill_parent"        android:background="#FFF">        <ImageButton android:id="@+id/ImageButton01"             android:layout_width="wrap_content"             android:layout_height="wrap_content">        </ImageButton>    </LinearLayout>layout/xxxx2.xml<?xml version="1.0" encoding="utf-8"?>    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"        android:layout_width="fill_parent"         android:layout_height="fill_parent"        android:background="#FFF">        <ImageButton android:id="@+id/ImageButton01"             android:layout_width="wrap_content"             android:layout_height="wrap_content">        </ImageButton>    </LinearLayout>layout/xxxxx.xml<?xml version="1.0" encoding="utf-8"?><TabHost xmlns:android="http://schemas.android.com/apk/res/android"    android:id="@android:id/tabhost"    android:layout_width="fill_parent"    android:layout_height="fill_parent">    <LinearLayout        android:orientation="vertical"        android:layout_width="fill_parent"        android:layout_height="fill_parent">        <TabWidget android:id="@android:id/tabs"            android:layout_width="fill_parent"            android:layout_height="68dip"            android:paddingLeft="1dip"            android:paddingRight="1dip"            android:paddingTop="4dip"        />        <FrameLayout android:id="@android:id/tabcontent"            android:layout_width="fill_parent"            android:layout_height="0dip"            android:layout_weight="1"        />    </LinearLayout></TabHost>

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. ANDROID解决屏幕旋转而导致重启ACTIVITY
  2. Android手机软件汉化教程---第一课 apk安
  3. Android(安卓)01:AutoCompleteTextView-简
  4. maven管理android项目 环境搭建
  5. afinal框架之Android视频下载,指定路径
  6. Android平台上长连接的实现
  7. Android(安卓)编程下的 Secret Code
  8. android 通过http访问服务器数据
  9. Android(安卓)工程的创建
  10. ubuntu环境下android开发平台的搭建