Android 在选项卡布局中加载两个.swf苍蝇

Android 在选项卡布局中加载两个.swf苍蝇,android,tabs,flash,Android,Tabs,Flash,我使用一个选项卡布局,在三个选项卡中显示两个.swf文件和一个imageView。但是,当我想从swf选项卡更改为imageView时。主权财富基金仍然存在 //TabActivity public class TabSwfActivity extends TabActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedIn

我使用一个选项卡布局,在三个选项卡中显示两个.swf文件和一个imageView。但是,当我想从swf选项卡更改为imageView时。主权财富基金仍然存在

//TabActivity

public class TabSwfActivity extends TabActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Resources res = getResources(); // Resource object to get Drawables
        TabHost tabHost = getTabHost();  // The activity TabHost
        TabHost.TabSpec spec;  // Resusable TabSpec for each tab
        Intent intent;  // Reusable Intent for each tab

        // Create an Intent to launch an Activity for the tab (to be reused)
        intent = new Intent().setClass(this, OperatorActivity.class);

        // Initialize a TabSpec for each tab and add it to the TabHost
        spec = tabHost.newTabSpec("artists").setIndicator("artists")
                      .setContent(intent);
        tabHost.addTab(spec);

        // Do the same for the other tabs
        intent = new Intent().setClass(this, LearningActivity.class);
        spec = tabHost.newTabSpec("albums").setIndicator("albums")
                      .setContent(intent);
        tabHost.addTab(spec);

        intent = new Intent().setClass(this, QuestionActivity.class);
        spec = tabHost.newTabSpec("songs").setIndicator("songs")
                      .setContent(intent);
        tabHost.addTab(spec);

        tabHost.setCurrentTab(2);
    }
}
//main.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="wrap_content" />
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" />
    </LinearLayout>
</TabHost>
}

//learning.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<WebView android:id="@+id/webView1" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent">
</WebView>
</LinearLayout>

@昆芬:这个问题还不清楚。您开始将questionactivity选项卡设置为active,我假设这是带有imageview的选项卡。我想在Tabhost小部件中在flash文件和图片之间切换。但是,当我单击flash选项卡时,flash被加载,其中包含一个WebView,即使我单击了picture选项卡,flash仍将显示在屏幕前面。图片将始终处于闪光灯下。看起来您在暂停闪光灯时遇到问题。希望此链接将为您提供一些线索
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<WebView android:id="@+id/webView1" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent">
</WebView>
</LinearLayout>
public class QuestionActivity extends Activity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.questionlayout);
    }
}