posted 10 years ago
I am trying to build a simple android app using the ListView widget. Can this be done without the so called "adapter"? Because I don't yet understand adapters. In any case , I would like a very simple example to be able to follow. I use eclipse for android. I created a new project called Widgets_2_ListView and I have the activity-main.xml file as follows:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".MainActivity" >
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="16dp" >
</ListView>
</RelativeLayout>
I see a list of 7 items in the corresponding Graphical Layout.
Now what next? Suppose I want to give certain names to the list items and I want 10, not 7 items. What should I do? I would appreciate very much some help.