A simple way to show listview in Android using Xamarin

Ways to do it

There are basically 2 ways to do it in Android.

  • Using the Listview control
  • Using the ListActivity

By using ListActivity

In this way we don’t need to define any Listview in our AXML page. Just few lines of code will do it.

Output :

By adding Listview control

The way is very much similar. We need a ListAdapter to fill the ListView. The extra step we need to do is to add a ListView control to our AXML page.

AXML Page code

Design mode view of the above AXML
Let’s add the code to the Activity

Now, we are ready with our simple Listview in Android.

Hope that help. Happy coding 🙂

Categories: Android, CSharp, Visual Studio, Xamarin


Leave a Reply

%d bloggers like this: