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

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -