If there is only one ListView view in the current activity, you can quickly implement a list with listactivity, that is, the active activity inherits Listactivity. In the OnCreate method, you can create a list of users by simply two lines of code.
string[] items =New string[]{ "Listing 1","Listing 2","Listing 3","Listing 4","Listing 5","Listing 6","Listing 7","Listing 8" }; This. ListAdapter =Newarrayadapter<string> ( This, Android.resource.layout.simplelistitem1,items);
With Listactivity, you can create a simple list without calling the Setcontentview method. For more complex displays, you can customize the display layout and simpleadapter implementation. The layout of each subkey of the list is passed Android.Resource.Layout.SimpleListItem1. The system provides several simple layout styles.
Detailed introduction to each layout reference http://developer.android.com/reference/android/R.layout.html#simple_list_item_activated_1
To add a ListView click event, simply rewrite the Onlistitemclick method to
protected Override void int Long ID) { Toast.maketext (This,"click", Toastlength.long). Show (); }