Forum Xamarin.Android

Populating a listview by axml

I did read the basics of the getting started on xamarin docs but it just give me this code

[Activity(Label = "BasicTable", MainLauncher = true, Icon = "@drawable/icon")]
public class HomeScreen : ListActivity {
   string[] items;
   protected override void OnCreate(Bundle bundle)
       items = new string[] { "Vegetables","Fruits","Flower Buds","Legumes","Bulbs","Tubers" };
       ListAdapter = new ArrayAdapter<String>(this, Android.Resource.Layout.SimpleListItem1, items);
   protected override void OnListItemClick(ListView l, View v, int position, long id)

but it give me an error

Error CS0501: 'testeLista.HomeScreen.OnListItemClick(Android.Widget.ListView, Android.Views.View, int, long)' must declare a body because it is not marked abstract, extern, or partial (CS0501) (testeLista)

So i searched on google but nothing helped me, all i want to do is add horizontal layouts to my listview that is in my layout, is that possible?

Im thinking about crating a xml document with a template of my layout and what i want in it and then populiting my list with a lot of this layouts... please give me a light someone


Sign In or Register to comment.