protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); ClipboardInterface.GetInstance().SetClipboardManager((ClipboardManager)GetSystemService(Context.ClipboardService)); commManager = CommunicationManger.GetInstance(); txtState = FindViewById <TextView>(Resource.Id.txtState); progressBar = FindViewById <ProgressBar>(Resource.Id.progressBar1); var searchBtn = FindViewById <Button>(Resource.Id.searchBtn); txtState.Text = "Searching for server"; txtState.Visibility = ViewStates.Gone; progressBar.Visibility = ViewStates.Gone; searchBtn.Click += (sender, args) => SearchServer(30); onSearchEnd += SearchEnded; if (!commManager.IsBluetoothExists()) { Console.WriteLine("finished"); Toast.MakeText(this, "No bluetooth adapter found", ToastLength.Long); Finish(); return; } if (!commManager.IsBluetoothOn()) { Intent enableIntent = new Intent(BluetoothAdapter.ActionRequestEnable); StartActivityForResult(enableIntent, 2); } Console.WriteLine("finished setup"); }
private void TxtPassOnLongClick(object sender, View.LongClickEventArgs longClickEventArgs) { ClipboardInterface.GetInstance().CopyToClipboard(pass); Toast.MakeText(this.Activity, "copied", ToastLength.Short).Show(); }