listview如何添加多个

在一个activity布局文件中如何添加多个listview控件,或是如何通过fragment实现在一个activity中添加多个listview

xml布局中写几个不就OK了吗,或者代码中new几个,在使用layoutParams设置定位

在xml文件中定义,通过ID获取。
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content">

</ListView>
     <ListView
    android:id="@+id/listView2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

</ListView>