In my project i need contunistly read barcode and put them in a list. But while i trying it its always giving me NullReferenceException but i didn't get it. When i check it in debug i can see it have a string value but while trying put it to list its always giving me that error. Its my code for Scan and take data :
List<HoldMyString> mylist;
HoldMyString hold;
private void ZXingScannerView_OnScanResult(ZXing.Result result)
{
Device.BeginInvokeOnMainThread(() =>
{
hold.HoldString = result.Text; // HoldString is taking string value
mylist.Add(hold);
});
}
How i can put my datas in to my list contunistly. Thanks for help!