Android 为什么LayoutFlater在我的情况下不起作用?

Android 为什么LayoutFlater在我的情况下不起作用?,android,android-layout,android-emulator,android-widget,android-manifest,Android,Android Layout,Android Emulator,Android Widget,Android Manifest,我的main.xml布局仅包含一个按钮和一个LinearLayoutcontent\u区域,如下所示: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">

我的main.xml布局仅包含一个按钮和一个
LinearLayout
content\u区域,如下所示:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">


    <LinearLayout 
        android:id="@+id/myBtns"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:orientation="horizontal"
    >
        <Button
            android:id="@+id/btn_one"
            android:layout_width="100dip"
            android:layout_height="30dip"
                android:text="button one"
         />

    </LinearLayout>

    <LinearLayout 
        android:id="@+id/content_area"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
    >
         <!--inflate layout here-->

    </LinearLayout>


   </LinearLayout>
我尝试使用
LayoutInflater
content\u one.xml嵌入main.xml的
content\u区域

  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical">

        <TextView.../>
         ... 
        <Button .../>

    </LinearLayout>
public class MyActivity extends Activity{

      private LinearLayout contentArea;

      @Override
      public void onCreate(Bundle savedInstanceState) {

              super.onCreate(savedInstanceState);
              setContentView(R.layout.main);

              contentArea= (LinearLayout) findViewById(R.id.content_area);

              LayoutInflater inflater = (LayoutInflater)MyActivity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              View inflatedView = (View) inflater.inflate(R.layout.content_one, null);

              contentArea.addView(inflatedView);
}
但是它不起作用,content\u one.xml不显示在main.xml的
content\u区域中。我在eclipse中从LogCat获得了以下错误消息

请用鼠标右键单击以下图像并查看图像


为什么我的公寓不工作?我错在哪里?

视图可以正确充气,但是您在
MyBTN
布局上有一个
填充父项
高度,因此其他线性布局不可见。如果将其更改为
wrap\u content
,则可以看到另一条线性布局。

该日志不完整。。。粘贴整个日志(当然是发生错误的地方)。。。文本不是图像。@克里斯蒂安,我不知道如何从eclipse LogCat控制台复制整个错误消息,但我上传了另一个图像,它取代了旧的oneRight!,正因为如此。非常感谢。