i have a layout contains from two sections , the first section (without scroll) is for letters, the second section (with scroll) is for objects, how to put a list view on the second section? and have i make setcontentfiew(R.layout.menu)
on the oncreate()
?
this is the activity
public class FoodsMenu extends ListActivity {
String foods[];
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setListAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, foods));
}
}
this is the layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:fillViewport="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#000000"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="40dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#ffffff"
android:orientation="vertical" >
<TextView
android:id="@+id/tvA"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13dp"
android:layout_gravity="center"
android:textColor="#025f7c"
android:text="A" />
<TextView
android:id="@+id/tvB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13dp"
android:layout_gravity="center"
android:textColor="#025f7c"
android:text="B" />
<TextView
android:id="@+id/tvC"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13dp"
android:layout_gravity="center"
android:textColor="#025f7c"
android:text="C" />
<TextView
android:id="@+id/tvD"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13dp"
android:layout_gravity="center"
android:textColor="#025f7c"
android:text="D" />
</LinearLayout>
</LinearLayout>