コード例 #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            MobileBarcodeScanner.Initialize(Application);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

/*
 *          var toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);
 *          SetActionBar(toolbar);
 *          ActionBar.Title = "My Toolbar";
 */
            var btnScan     = FindViewById <Button>(Resource.Id.btnScan);
            var btnSend     = FindViewById <Button>(Resource.Id.btnSend);
            var btnSettings = FindViewById <Button>(Resource.Id.btnSettings);

            var lstView = FindViewById <ListView>(Resource.Id.lstView);

            var arrayAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1);

            lstView.Adapter = arrayAdapter;

            lstView.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs e)
            {
                Toast.MakeText(this, e.Position.ToString(), ToastLength.Long).Show();
            };

            btnSettings.Click += delegate
            {
                ShowSettings();
            };

            btnScan.Click += async delegate
            {
                AndroidScan scan = new AndroidScan(this);
                await scan.StartNewScanAsync();
            };
            btnSend.Click += delegate
            {
                SendEmail();
            };

            if (!SettingsSet())
            {
                ShowSettings();
            }
        }
コード例 #2
0
ファイル: AddEditActivity.cs プロジェクト: IgorZag/Carlos
 private async Task  ScanAgain()
 {
     AndroidScan scan = new AndroidScan(base.Parent);
     await scan.StartNewScanAsync();
 }