Forum Xamarin Xamarin.Android

listView, ArrayAdapter SimpleListItem1Help

I'm trying to use pull data from MySQL to a list view but the code I have built is only displaying the very last entry within MySQL.

if I have 25 rows in the MySQL database and I want to display data from the rows that have 'soothe' within the rows, the code will only display row 25.
row 2, 8, 13, and 25 have the word 'soothe' within them. I want to display all 4 of those rows but my listview only displays one Item within the listview.

The code I have been working with.

                       MySqlDataReader mdr;
                            command = new MySqlCommand(selectFromDB, con);
                            mdr = command.ExecuteReader();

                            mItems = new List<string>();

                            ArrayAdapter<string> adapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, mItems);

                            mlistview.Adapter = adapter;                       

I think this has something to do with the UI not updating. I have looked around the internet but I'm stuck. can someone please point me in the correct direction?

Best Answer


  • BlueScreenThisBlueScreenThis USMember ✭✭

    this is a duplicate of

    when I posted this, Xamarin forums had removed it for some reason. I see its back.....

Sign In or Register to comment.