android: start an intent into a framelayout

Posted by user329692 on Stack Overflow See other posts from Stack Overflow or by user329692
Published on 2010-05-03T22:14:28Z Indexed on 2010/05/03 22:18 UTC
Read the original article Hit count: 644

Filed under:
|
|

Hi guys!

I have a main activity with this layout file:

<?xml version="1.0" encoding="utf-8"?>

<Button 
    android:id="@+id/btn_reload"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Reload" 
 />

 <LinearLayout 
    android:id="@+id/LinearLayout01" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:gravity="center_vertical|center_horizontal"
 >
    <ImageView 
        android:id="@+id/ImageView01" 
        android:src="@drawable/logo_head" 
        android:scaleType="fitStart" 
        android:adjustViewBounds="true" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" />
 </LinearLayout>

</LinearLayout>

<FrameLayout 
    android:id="@+id/center" 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent" 
    android:layout_weight="1">
</FrameLayout>

<LinearLayout 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent" 
    android:gravity="center" 
    android:id="@+id/footer"
    android:layout_weight="2.6"
    android:background="#ffffff">
</LinearLayout>

Basically it is composed by an header, a central part (android:id="@+id/center") and a footer. The footer contains four buttons, created dinamically. At the end it looks like a TabWidget with the tabs at the botton.

Each footer's buttons holds an Intent/activity.

The question is: How can i start my activity into the FrameLayout? For instance TabHost does this:

       .....
spec = tabHost
        .newTabSpec(tabTitle.toLowerCase())
        .setIndicator(tabTitle,res.getDrawable(R.drawable.tab_spec))
        .setContent(intent);
        tabHost.addTab(spec);
....

© Stack Overflow or respective owner

Related posts about android

Related posts about intent