Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Crash while creating MultipleChoiceView

$
0
0

Can anyone tell me what is wrong with this? Im trying to do this for the first time so I suppose it must be something unbelievably stupid.. :D Thanks for any help ;)

XML: ScrollView xmlns:p1="http://schemas.android.com/apk/res/android" p1:minWidth="25px" p1:minHeight="25px" p1:layout_width="match_parent" p1:layout_height="match_parent" p1:id="@+id/scrollView1"> ListView p1:minWidth="25px" p1:minHeight="25px" p1:layout_width="match_parent" p1:layout_height="match_parent" p1:id="@+id/listAbsence" /ScrollView

Code:

string[] items = new string[] { "Option 1", "Option 2", "Option 3", "Option 4", "Option 5" };

ArrayAdapter lol = new ArrayAdapter (this, Android.Resource.Layout.SimpleListItemMultipleChoice, items);

ListView lv = FindViewById(Resource.Id.listAbsence);
lv.ChoiceMode = Android.Widget.ChoiceMode.Multiple; lv.Adapter = lol;

It throws Instance of the object-error at Choice mode setting..


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>