All of these examples are based on a ListActivity. By default this will give you an interface which is just a list. If you need a more sophisticated layout you can use a ListActivity with a custom layout (covered later in the series).
Here we use an ArrayAdapter as a ListAdapter. This is really simple, it takes a list of strings and then deals with showing them in the list. When it's running it looks like this...
Handling Item Clicks
To handle item clicks we can override OnListItemClick. Here we just popup some toast.
Alternatively you can subscribe to the click event. For long clicks you always need to subscribe to the event. Subscribe in the OnCreate method.
And then handle the click.
Good sharing on series post on Android ListViews in Xamarin. Hire Xamarin Authorized Partners for your Xamarin Apps Development.
ReplyDelete