c# - foreach loop and "Object reference not set to an instance of an object" -
c# - foreach loop and "Object reference not set to an instance of an object" -
i using code:
setcontentview (resource.layout.results); // create application here string[] listresults = intent.getstringarrayextra ("resultdata"); linearlayout linear = findviewbyid<linearlayout> (resource.id.linear); textview resultspaste = findviewbyid<textview> (resource.id.resultspaste); foreach(string item in listresults) { resultspaste.text += item; };
and receiving object reference not set instance of object
next foreach
. have researched , can't find on it.
why receiving error?
listresults, resultspaste or both null. set breakpoint before foreach , check variables.
c# foreach xamarin
Comments
Post a Comment