private void SetupFormats() { List <BarcodeFormat> formats = new List <BarcodeFormat>(); if (SelectedIndices == null) { SelectedIndices = new List <Integer>(); for (int i = 0; i < ZXingScannerView.AllFormats.Count; i++) { SelectedIndices.Add(Integer.ValueOf(i)); } } foreach (int index in SelectedIndices) { formats.Add(ZXingScannerView.AllFormats[index] as BarcodeFormat); } if (ScannerView != null) { ScannerView.SetFormats(formats); } }