private View SetupView(View aView)
        {
            Switch lSwAskNonStdAdapter = aView.FindViewById <Switch>(Resource.Id.swAskNonStandardAdapter);

            lSwAskNonStdAdapter.Checked        = PreferenceHelper.GetValue <bool>(ExtContext, PreferenceKeys.ASK_NON_STD_ADAPTER, false);
            lSwAskNonStdAdapter.CheckedChange += (sender, e) =>
            {
                PreferenceHelper.SetValue(ExtContext, PreferenceKeys.ASK_NON_STD_ADAPTER, e.IsChecked);
            };

            return(aView);
        }
Beispiel #2
0
        private void SelectOtherDevice(Action aCallbackError)
        {
            if (PreferenceHelper.GetValue <bool>(Activity, PreferenceKeys.ASK_NON_STD_ADAPTER, false) == false)
            {
                return;
            }

            RunOnUiThread(() =>
            {
                DialogHelper.ShowToast(Activity, Resource.String.standard_device_not_found, ToastLength.Long);
                List <IListPrompt> lItems = new List <IListPrompt>(AndroidOBDBluetoothConnection.Current.BondedDeviceNames);
                if (lItems.Count > 0)
                {
                    DialogHelper.DisplayListPrompt(Activity, lItems, (sender, e) =>
                    {
                        AndroidOBDBluetoothConnection.Current.Start(lItems[e.Which].Text, aCallbackError);
                    });
                }
                else
                {
                    DialogHelper.ShowToast(Activity, Resource.String.no_devices_found, ToastLength.Long);
                }
            });
        }