Android 如何在一个活动中打开不同的活动,如(活动和中间显示选项卡布局)

Android 如何在一个活动中打开不同的活动,如(活动和中间显示选项卡布局),android,android-layout,tabs,Android,Android Layout,Tabs,我想在一个活动中显示两个活动…一个显示在顶部,另一个显示在中间的显示选项卡上(关于,图库提要) 两者必须在同一屏幕上显示 我正在使用actionbarSherlock库 这是我的布局 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_con

我想在一个活动中显示两个活动…一个显示在顶部,另一个显示在中间的显示选项卡上(关于,图库提要) 两者必须在同一屏幕上显示 我正在使用actionbarSherlock库

这是我的布局

<?xml version="1.0" encoding="utf-8"?>
     <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#FFFFFF" >
    <RelativeLayout 
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="200dp"
    android:layout_height="200dp"
    android:layout_marginLeft="63dp"
    android:layout_marginTop="19dp"
    android:padding="20dp"
    android:scaleType="centerCrop"
    android:src="@drawable/loader" />

</RelativeLayout>

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="match_parent"
            android:background="#00ffffff" >

            <ImageView
                android:id="@+id/image_frm"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_marginBottom="300dp"
                android:src="@drawable/img_frame" />

            <RelativeLayout
                android:id="@+id/relativeLayout1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignBottom="@+id/image_frm" >
            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/relativeLayout2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginLeft="29dp"
                android:layout_toRightOf="@+id/relativeLayout1" >
            </RelativeLayout>

            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignBottom="@+id/image_frm"
                android:layout_alignLeft="@+id/relativeLayout1" >
            </RelativeLayout>



        </RelativeLayout>

       <RelativeLayout
android:id="@+id/relativelayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="#00ffffff" >




<TextView
    android:id="@+id/userfullname"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="2dp"
    android:text="UsFn"
    android:textColor="#DF0B0B"
    android:textSize="30dip" />

<Button
    android:id="@+id/logout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/userfullname"
    android:layout_marginTop="118dp"
    android:text="Log Out" />

<Button
    android:id="@+id/btn_edit"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/logout"
    android:layout_alignParentLeft="true"
    android:layout_marginLeft="15dp"
    android:background="@drawable/btn_green"
    android:text="Edit " />

我想在此布局中显示选项卡 请帮助我,我真的很困惑,而且对android非常陌生
感谢您的帮助

一个简单的解决方案会帮您找到的。片段基本上是两种布局,可以以多种不同的方式使用。

先生,我对Android非常陌生。你能通过我答案中的链接告诉我如何处理片段吗。您的新应用程序很好,但我们不为您编写代码。如果你在谷歌上搜索“片段”或“片段示例”,你会发现很多不同的实现。如果你想成为安卓开发者,谷歌搜索必须是你最好的朋友。不要气馁;)在我们发展的早期阶段,我们都问过这样一个问题。同样,你只需要经常使用谷歌。试着用更具体的语言回答你的问题:“如何在活动中嵌套活动”