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

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -