java - ListView in Xamarin Android application -
i'm trying create listview in xamarin android, , run foreach loop on collection populate listview. however, i'm having problems getting listview working properly.
i have:
listview uuidlistview = findviewbyid<listview> (resource.id.uuidlist); uuidlistview.adapter = new arrayadapter (this, resource.layout.uuidlist, "some text");
the response when run programme is:
the best overloaded method match 'android.widget.arrayadapter.arrayadapter(android.content.context, int, int)' has invalid arguments.
why looking 2 integer arguments?
please explain in basic terminology possible i'm new. thanks.
once sorted out, need run foreach loop on collection this:
foreach (string uuid in uuids) { if (uuid != "")
and populate listview uuid values not equal "". help on great too.
android documentation
the first integer layout file, sec file text view within layout.
change:
uuidlistview.adapter = new arrayadapter ( this, resource.layout.uuidlist, "some text");
to
uuidlistview.adapter = new arrayadapter ( this, resource.layout.uuidlist, resource.id.textview1);
where textview1 id of text field on layout.
java android listview xamarin monodroid
No comments:
Post a Comment