android – 如何在main.xml中插入list.xml文件

有人帮我做下面的事!
我想在main.xml文件底部插入一些list list.xml文件.怎么实现呢?

   ----------------------------
    |    main.java              |
    |    main.xml               |
    |                           |
    |                           |
    |                           |
    |                           |
    |      ______               |
    |     |button|              |
    |                           |
    |                           |
    |                           |
    | _________________________ | 
    | |      list.java        | |
    | |      list.xml         | |
    | |                       | |
    | |                       | |
    | |                       | |
    | |                       | |
    | |                       | |
    |_|_______________________|_| 

I called list.java by using intent on the main.java .I also include list.xml to main.xml. When I press button list.xml should pop up like above figure. But list.xml comes up new window. How to solve this problem?

解决方法:

由于您想重新使用布局,即在其他布局中包含现有布局,我建议您阅读本文:Re-using Layouts with <include/>.

现在,您希望在main.xml中包含list.xml,请写入< include />在main.xml里面如下:

 <include layout="@layout/list"/>

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念