I'm trying to implement activity with ListView among other widgets. So if I understand correctly I can't use ListActivity (because it shows only one big ListView that ist ok for me).
I found a lot different examples of doing this in java from SO like this
or
this
or great example.
I've tried to do in same way but it doesn't work correctly. I'm curious is this functionality exists in mono android at all?
I found only one example of using ListView in mono android which is this and this example describe using ListActivity only.
So, my layout:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
android:id="@+id/widget36"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</ListView>
</TableLayout>
My OnCreate:
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.CreateUser);
JavaList<string> somadata = new JavaList<string> { "111", "222", "333" };
ListView view = FindViewById<ListView>(Resource.Id.list);
view.Adapter = new ArrayAdapter<string>(this, Resource.Layout.CreateUser, somadata);
view.TextFilterEnabled = true;
}