public override void OnCreate(Bundle saveStateInstance) { base.OnCreate (saveStateInstance); SetHasOptionsMenu (true); //make sure you have a dismiss button or something for devices orderDialog = new Android.Support.V7.App.AlertDialog.Builder (this.Activity); orderDialog.SetTitle ("Woah There!"); orderDialog.SetMessage ("You forgot to fill in every field."); orderDialog.SetPositiveButton ("Thanks!", delegate { }); }
public void AskForString (string message, string title, Action<string> returnString) { var builder = new Android.Support.V7.App.AlertDialog.Builder (BaseActivity.CurrentActivity); //builder.SetIcon (Resource.Drawable.ic_launcher); builder.SetTitle (title ?? string.Empty); builder.SetMessage (message); var view = View.Inflate (BaseActivity.CurrentActivity, Resource.Layout.dialog_ask_text, null); builder.SetView (view); var textBoxName = view.FindViewById<EditText> (Resource.Id.text); builder.SetCancelable (true); builder.SetNegativeButton (Android.Resource.String.Cancel, delegate { }); builder.SetPositiveButton (Android.Resource.String.Ok, (sender, which) => { if (string.IsNullOrWhiteSpace (textBoxName.Text)) return; returnString (textBoxName.Text); }); BaseActivity.CurrentActivity.RunOnUiThread (() => { var alertDialog = builder.Create (); alertDialog.Show (); }); }
public static Android.Support.V7.App.AlertDialog ShowDialog(Activity activity, int messageResId, int titleResId) { Android.Support.V7.App.AlertDialog.Builder builder = new Android.Support.V7.App.AlertDialog.Builder(activity); return builder.SetMessage(messageResId) .SetTitle(titleResId) .Show(); }
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var root = inflater.Inflate (Resource.Layout.fragment_friends, container, false); var friendGrid = root.FindViewById<GridView> (Resource.Id.grid); friendGrid.ItemClick += FriendClicked; friendGrid.Adapter = new FriendAdapter (Activity, viewModel); friendGrid.LongClickable = true; friendGrid.ItemLongClick += (sender, e) => { var friend = viewModel.Friends[e.Position]; viewModel.ExecuteFlagFriendCommand(friend.FriendId, friend.Name); }; var fab = root.FindViewById<FloatingActionButton> (Resource.Id.fab); fab.AttachToListView (friendGrid); fab.Click += (sender, e) => { var builder = new Android.Support.V7.App.AlertDialog.Builder (Activity); builder.SetTitle (Resource.String.add_friend) .SetItems (new [] { Resources.GetString (Resource.String.add_by_email), Resources.GetString (Resource.String.pick_contact) }, this); builder.Create ().Show (); }; refresher = root.FindViewById<SwipeRefreshLayout> (Resource.Id.refresher); refresher.Refresh += (sender, e) => viewModel.ExecuteLoadFriendsCommand (); return root; }
//Choosing coffee //List<string> coffee, size, milk; //ExpandableListView coffeeLv; //ExpandableListAdapter coffeeAdapter; protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.Order); supportToolbar = this.FindViewById<SupportToolbar> (Resource.Layout.order_menu); SetSupportActionBar (supportToolbar); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled (true); SupportActionBar.SetDisplayShowTitleEnabled (true); SupportActionBar.Title = "TapTap Coffee"; //make sure you have a dismiss button or something for devices orderDialog = new Android.Support.V7.App.AlertDialog.Builder (this); orderDialog.SetTitle ("Woah There!"); orderDialog.SetMessage ("You forgot to fill in every field."); orderDialog.SetPositiveButton ("Thanks!", delegate { }); //Implement variable pricing... //coffeeData = new Dictionary<string, List<string>> (); //GetCoffeeData (); //coffeeDataHeaders = new List<string> (coffeeData.Keys); //coffeeAdapter = new ExpandableListAdapter (this, coffeeData, coffeeDataHeaders); cafeFragment = new CafeFragment (TempStorage.Cafes, new CafeAdapter (this, TempStorage.Cafes)); FragmentManager.BeginTransaction ().Replace (Resource.Id.frame_action, cafeFragment).Commit (); }
public override Dialog OnCreateDialog(Bundle savedInstanceState) { var p = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); var view = new LinearLayout(_context); view.LayoutParameters = p; var optionHolder = new LinearLayout(_context); optionHolder.Orientation = Orientation.Vertical; optionHolder.LayoutParameters = p; foreach (var option in _options) { optionHolder.AddView(AddCategoryRow(option)); } var scrollView = new ScrollView(_context); scrollView.LayoutParameters = p; scrollView.AddView(optionHolder); view.AddView(scrollView); var dialog = new Android.Support.V7.App.AlertDialog.Builder(_context); dialog.SetTitle(_title); dialog.SetView(view); //dialog.SetNegativeButton("Cancel", (s, a) => { }); dialog.SetPositiveButton("Ok", (s, a) => { }); return dialog.Create(); }
public static Android.Support.V7.App.AlertDialog ShowOkDialog(Activity activity, int messageResId, int titleResId, EventHandler<DialogClickEventArgs> okEventHandler=null) { Android.Support.V7.App.AlertDialog.Builder builder = new Android.Support.V7.App.AlertDialog.Builder(activity); return builder.SetMessage(messageResId) .SetTitle(titleResId) .SetPositiveButton(Android.Resource.String.Ok, okEventHandler ?? ((sender, args) => { })) .Show(); }
/// <summary> /// A method for going to the activty that this ViewPager should lead to. /// </summary> protected override void BackWarning() { var dialog = new Android.Support.V7.App.AlertDialog.Builder(Activity); dialog.SetMessage(Resource.String.event_warning_edit); dialog.SetPositiveButton(Resource.String.yes, (s, earg) => Back()); dialog.SetNegativeButton(Resource.String.no, (s, earg) => { }); dialog.Show(); }
/// <summary> /// Shows the user an alert of they try to log out by pressing the hardware back button. /// </summary> public override void OnBackPressed() { var dialog = new Android.Support.V7.App.AlertDialog.Builder(this); dialog.SetMessage(Resources.GetString(Resource.String.message_logout)); dialog.SetNegativeButton(Resource.String.no, (s, e) => { }); dialog.SetPositiveButton(Resource.String.yes, (s, e) => MainActivity.CIF.Logout(this)); dialog.Show(); }
public static Android.Support.V7.App.AlertDialog ShowYesNoDialog(Activity activity, int messageResId, int titleResId, EventHandler<DialogClickEventArgs> yesEventHandler=null, EventHandler<DialogClickEventArgs> noEventHandler=null) { Android.Support.V7.App.AlertDialog.Builder builder = new Android.Support.V7.App.AlertDialog.Builder(activity); return builder.SetMessage(messageResId) .SetTitle(titleResId) .SetPositiveButton(Resource.String.label_yes, yesEventHandler ?? ((sender, args) => { })) .SetNegativeButton(Resource.String.label_no, noEventHandler ?? ((sender, args) => { })) .Show(); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); var view = inflater.Inflate(Resource.Layout.SubmittedFragment, container, false); View header = Activity.LayoutInflater.Inflate(Resource.Layout.SubmittedHeader, null); exportList = view.FindViewById<ListView>(Resource.Id.submitted_list); exportList.AddHeaderView(header, null, false); LoadData(); exportList.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args) { // The list's header borks indexing res = results[args.Position - 1]; View alertView = Activity.LayoutInflater.Inflate(Resource.Layout.SubmittedAlert, null); Button feedbackBtn = alertView.FindViewById<Button>(Resource.Id.submittedAlert_feedbackBtn); feedbackBtn.Click += feedbackBtn_Click; Button permissionsBtn = alertView.FindViewById<Button>(Resource.Id.submittedAlert_permission); permissionsBtn.Click += permissionsBtn_Click; Android.Support.V7.App.AlertDialog alert = new Android.Support.V7.App.AlertDialog.Builder(Activity) .SetTitle("What would you like to do with this submission?") .SetView(alertView) .SetCancelable(true) .SetNegativeButton("Delete", (EventHandler<DialogClickEventArgs>)null) .SetNeutralButton("Close", (s, a) => { }) .Create(); alert.Show(); // A second alert dialogue, confirming the decision to delete Button deleteBtn = alert.GetButton((int)DialogButtonType.Negative); deleteBtn.Click += delegate(object s, EventArgs e) { Android.Support.V7.App.AlertDialog.Builder confirm = new Android.Support.V7.App.AlertDialog.Builder(Activity); confirm.SetTitle("Are you sure?"); confirm.SetMessage("The recorded data will be deleted from the server and irrecoverably lost. Continue?"); confirm.SetPositiveButton("Delete", (senderAlert, confArgs) => { ServerData.PushResultDeletion(res); exportList.Adapter = null; LoadData(); alert.Dismiss(); }); confirm.SetNegativeButton("Cancel", (senderAlert, confArgs) => { }); confirm.Show(); }; }; return view; }
public void SelectOption (string title, string[] options, Action<int> confirmationAction) { var builder = new Android.Support.V7.App.AlertDialog.Builder (BaseActivity.CurrentActivity); builder.SetTitle (title) .SetItems (options, (sender, args) => confirmationAction (args.Which)) .SetNegativeButton ("Cancel", delegate { }); BaseActivity.CurrentActivity.RunOnUiThread (() => builder.Create ().Show ()); }
public static Android.Support.V7.App.AlertDialog CreateFullScreenIndeterminateProgressDialog(Context context) { var builder = new Android.Support.V7.App.AlertDialog.Builder(context); builder.SetView(LayoutInflater.From(context).Inflate(Resource.Layout.loader, null)); //builder.SetCancelable(false); builder.SetRecycleOnMeasureEnabled(true); builder.SetInverseBackgroundForced(true); var dialog = builder.Create(); dialog.Window.SetBackgroundDrawable(new ColorDrawable(Color.Transparent)); return dialog; }
private void LvCentralUnits_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { var centralUnitToDelete = App.Bootstrapper.SettingsViewModel.CentralUnits.ElementAt(e.Position); if (centralUnitToDelete != null) { var builder = new Android.Support.V7.App.AlertDialog.Builder(this); builder.SetMessage(Resource.String.confirm_delete_message); builder.SetPositiveButton(Resource.String.delete, (ev, se) => App.Bootstrapper.SettingsViewModel.DeleteCentralUnitCommand.Execute(centralUnitToDelete)); builder.SetNegativeButton(Android.Resource.String.Cancel, (ev, se) => { }); builder.Show(); } }
public void SendMessage (string message, string title = null) { var builder = new Android.Support.V7.App.AlertDialog.Builder (BaseActivity.CurrentActivity); builder .SetTitle (title ?? string.Empty) .SetMessage (message) .SetPositiveButton (Android.Resource.String.Ok, delegate { }); BaseActivity.CurrentActivity.RunOnUiThread (() => { var alert = builder.Create (); alert.Show (); }); }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case 0: var dialog = new Android.Support.V7.App.AlertDialog.Builder(this); dialog.SetMessage(Resource.String.delete_account); dialog.SetPositiveButton(Resource.String.yes, (s, e) => ConfirmDeletion()); dialog.SetNegativeButton(Resource.String.no, (s, e) => { }); dialog.Show(); break; default: break; } return base.OnOptionsItemSelected(item); }
public void SendConfirmation(string message, string title, System.Action<bool> confirmationAction) { var activity = AndroidUtils.Context as Activity; var builder = new Android.Support.V7.App.AlertDialog.Builder(activity); builder .SetTitle(title ?? string.Empty) .SetMessage(message) .SetPositiveButton(Android.Resource.String.Ok, delegate { confirmationAction(true); }).SetNegativeButton(Android.Resource.String.Cancel, delegate { confirmationAction(false); }); var alert = builder.Create(); alert.Show(); }
private void Logout() { Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this); alert.SetTitle(Strings.logout_comfirm); alert.SetPositiveButton(Strings.cancel, (senderAlert, args) => { }); alert.SetNeutralButton(Strings.logout, (senderAlert, args) => { Android.Preferences.PreferenceManager.GetDefaultSharedPreferences(this).Edit().Clear(); Globe.SharedInstance.User = new User(); Globe.SharedInstance.PostFeeds.Clear(); StartActivity(typeof(LandingActivity)); Finish(); }); alert.Show(); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.HomeActivity, container, false); toolbarLayout = view.FindViewById(Resource.Id.toolbarLayout); ((TextView)toolbarLayout.FindViewById(Resource.Id.toolbar_titleCenter)).Text = "Notifications"; toolbarImageFarLeft = (ImageView)toolbarLayout.FindViewById(Resource.Id.toolbar_imageFarLeft); toolbarImageFarLeft.Visibility = ViewStates.Visible; Drawable trash = Context.Resources.GetDrawable(Resource.Drawable.delete); trash.SetColorFilter(Resources.GetColor(Resource.Color.tenBlue), PorterDuff.Mode.SrcAtop); toolbarImageFarLeft.SetImageDrawable(trash); toolbarImageFarLeft.Click += (sender, e) => { Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(Context); alert.SetTitle(Strings.clear_notificaitons); alert.SetMessage(Strings.clear_notificaions_confirm); alert.SetPositiveButton(Strings.yes, (senderAlert, args) => { DeleteAllNotifications(); }); alert.SetNeutralButton(Strings.no, (senderAlert, args) => { }); alert.Show(); }; NotificationFragment = new NotificationFeedFragment(); NotificationFragment.Master = this; NotificationFragment.Target = FeedTypeEnum.FeedType.NotificationFeed; NotificationFragment.EmptyTableString = Strings.no_notifications; NotificationFragment.NewPageContainerID = Resource.Id.search_container; NotificationFragment.NoTableData += () => { toolbarImageFarLeft.Visibility = ViewStates.Invisible; }; NotificationFragment.HasTableData += () => { toolbarImageFarLeft.Visibility = ViewStates.Visible; }; FragmentManager.BeginTransaction().Add(Resource.Id.fragment_container, NotificationFragment).Commit(); return view; }
public void SendConfirmation (string message, string title, Action<bool> confirmationAction) { var builder = new Android.Support.V7.App.AlertDialog.Builder (BaseActivity.CurrentActivity); builder .SetTitle (title ?? string.Empty) .SetMessage (message) .SetPositiveButton (Android.Resource.String.Ok, delegate { confirmationAction (true); }) .SetNegativeButton (Android.Resource.String.Cancel, delegate { confirmationAction (false); }); BaseActivity.CurrentActivity.RunOnUiThread (() => { var alert = builder.Create (); alert.Show (); }); }
private void button_PreferenceClick(object sender, Preference.PreferenceClickEventArgs e) { Android.Support.V7.App.AlertDialog alert = new Android.Support.V7.App.AlertDialog.Builder(Activity) .SetTitle("Revoke access to your Google account?") .SetMessage("This will result in the deletion of some of your user data. Are you really sure?") .SetNegativeButton("Cancel", (arg1, arg2) => { }) .SetPositiveButton("Delete Data", (arg1, arg2) => { AppData.Session = null; AppData.SaveCurrentData(); Intent intent = new Intent(Activity, typeof(LoginActivity)); intent.PutExtra("revokeGoogle", true); StartActivity(intent); Activity.Finish(); }) .Create(); alert.Show(); }
public static Android.Support.V7.App.AlertDialog.Builder BuildDialog( Context context, string title, string message, Action<object, DialogClickEventArgs> positiveAction, Action<object, DialogClickEventArgs> negativeAction, Action<object, DialogClickEventArgs> neutralAction, int positiveButtonResource, int negativeButtonResource, int neutralButtonResource) { var builder = new Android.Support.V7.App.AlertDialog.Builder(context, Resource.Style.AppCompatAlertDialogStyle); builder.SetTitle(title); builder.SetMessage(message); if (positiveAction != null) builder.SetPositiveButton(positiveButtonResource, (sender,e) => positiveAction(sender,e)); if (neutralAction != null) builder.SetNeutralButton(neutralButtonResource, (sender,e) => neutralAction(sender,e)); if (negativeAction != null) builder.SetNegativeButton(negativeButtonResource, (sender,e) => negativeAction(sender,e)); return builder; }
protected override void OnCreate (Bundle savedInstanceState) { base.OnCreate (savedInstanceState); SetContentView (Resource.Layout.ActivePast); supportToolbar = this.FindViewById<SupportToolbar> (Resource.Layout.back_menu); SetSupportActionBar (supportToolbar); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled (true); SupportActionBar.SetDisplayShowTitleEnabled (true); SupportActionBar.Title = "TapTap Coffee"; filter = Intent.GetStringExtra ("Query"); confirmedDialog = new Android.Support.V7.App.AlertDialog.Builder (this); confirmedDialog.SetTitle ("Order Received"); confirmedDialog.SetMessage ("Your order was received and paid!"); confirmedDialog.SetPositiveButton ("Great!", delegate { }); orders = GetOrders (Intent.GetStringExtra ("Query")); if (orders.Count > 0) { //frame layout slow ActivePastFragment activePast = new ActivePastFragment (orders, new OrderAdapter (this, orders)); FragmentManager.BeginTransaction ().Replace (Resource.Id.variable_frlayout, activePast).Commit (); } else { //framelayout slow NoOrdersFragment noOrders = new NoOrdersFragment (); FragmentManager.BeginTransaction ().Replace (Resource.Id.variable_frlayout, noOrders).Commit (); } if (Intent.GetStringExtra ("Past") == "pay") { confirmedDialog.Show (); } }
public static Task<string> ShowChannelDialog(Activity activity) { var tcs = new TaskCompletionSource<string>(); var inputDialog = new Android.Support.V7.App.AlertDialog.Builder(activity); var userInput = new EditText(inputDialog.Context) {Hint = "Join Channel"}; string selectedInput = "Join Channel"; userInput.Text = "general"; //SetEditTextStylings(userInput); userInput.InputType = Android.Text.InputTypes.ClassText; inputDialog.SetTitle(selectedInput); inputDialog.SetView(userInput); inputDialog.SetPositiveButton( "Ok", (see, ess) => { tcs.SetResult(userInput.Text != string.Empty ? userInput.Text : ""); //HideKeyboard(userInput); HideKeyboard(activity, userInput); }); inputDialog.SetNegativeButton("Cancel", (afk, kfa) => HideKeyboard(activity, userInput)); inputDialog.Show(); return tcs.Task; }
void GoOnlineButton_Click(object sender, EventArgs e) { if (!CheckSpecialPermission()) { return; } if (availablityStatus) { Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this); alert.SetTitle("GO OFFLINE"); alert.SetMessage("You will not be able to receive Ride Request"); alert.SetPositiveButton("Continue", (senderAlert, args) => { homeFragment.GoOffline(); goOnlineButton.Text = "Go Online"; goOnlineButton.Background = ContextCompat.GetDrawable(this, Resource.Drawable.uberroundbutton); availablityStatus = false; TakeDriverOffline(); }); alert.SetNegativeButton("Cancel", (senderAlert, args) => { alert.Dispose(); }); alert.Show(); } else { availablityStatus = true; homeFragment.GoOnline(); goOnlineButton.Text = "Go offline"; goOnlineButton.Background = ContextCompat.GetDrawable(this, Resource.Drawable.uberroundbutton_green); } }
public override void OnBackPressed() { if (TRIMMODE) { TRIMMODE = false; _adapter.TrimMode(null, false); preview.StopPlayback(); _adapter.UpdatePlaying(null); TrimOff(); return; } if (IsExpanded) { currentpick = null; CollapsePane(); (allclipsfragment as IImagePausable).Pause(); } else { Android.Support.V7.App.AlertDialog.Builder builder = new Android.Support.V7.App.AlertDialog.Builder(this); builder.SetMessage(Resource.String.savecancelmsg); builder.SetPositiveButton(Resource.String.savebtnshort, (e, o) => { ExitSave(); }) .SetNegativeButton(Resource.String.cancelbtn, async(e, o) => { //Reset back to old version: //CurrentEdit = OriginalVersion; ShouldAutoSave = false; await Bootlegger.BootleggerClient.SaveEdit(OriginalVersion); Finish(); }); builder.Create().Show(); } }
private void Adapter_ItemClick(object sender, ServicesAdapterClickEventArgs e) { HealthService service = services[e.Position]; var builder = new Android.Support.V7.App.AlertDialog.Builder(this); builder.SetTitle(Resource.String.when_do_you_need_service); builder.SetNegativeButton(Resource.String.cancel, (sender2, e2) => { }); ArrayAdapter <string> dialogAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1); dialogAdapter.Add(Resources.GetString(Resource.String.now)); dialogAdapter.Add(Resources.GetString(Resource.String.later)); builder.SetAdapter(dialogAdapter, async(sender2, e2) => { string option = dialogAdapter.GetItem(e2.Which); if (option == Resources.GetString(Resource.String.now)) { Intent returnIntent = new Intent(); returnIntent.PutExtra("serviceId", service.Id); returnIntent.PutExtra("serviceName", service.Name); SetResult(Result.Ok, returnIntent); Finish(); } else { Intent intent = new Intent(this, typeof(SelectTimeActivity)); intent.PutExtra("serviceId", service.Id); intent.PutExtra("serviceName", service.Name); StartActivityForResult(intent, SELECT_TIME_REQUEST_CODE); } }); builder.Show(); }
public override Dialog OnCreateDialog(Bundle savedInstanceState) { var inflater = (LayoutInflater)_context.GetSystemService(Context.LayoutInflaterService); var view = inflater.Inflate(Resource.Layout.NumberPickerDialog, null); var numberPicker = view.FindViewById<NumberPicker>(Resource.Id.numberPicker); numberPicker.MaxValue = _options.Maximum; numberPicker.MinValue = _options.Minimum; numberPicker.Value = _options.Initial; List<string> values = new List<string>(); for (var i = _options.Minimum; i <= _options.Maximum; i += 1) { values.Add((i * _options.Step) + _options.DisplaySuffix); } numberPicker.SetDisplayedValues(values.ToArray()); //numberPicker.SetDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS); var dialog = new Android.Support.V7.App.AlertDialog.Builder(_context); dialog.SetTitle(_title); dialog.SetView(view); dialog.SetNegativeButton("Cancel", (s, a) => { }); dialog.SetPositiveButton("Ok", (s, a) => { if (NumberChanged != null) NumberChanged(this, new NumberPickerValueChanged { CallerKey = _callerKey, Value = numberPicker.Value }); }); numberPicker.ValueChanged += (object sender, NumberPicker.ValueChangeEventArgs e) => { if (NumberChanged != null) NumberChanged(this, new NumberPickerValueChanged { CallerKey = _callerKey, Value = e.NewVal }); }; return dialog.Create(); }
public void OnClick(View v) { Android.Support.V7.App.AlertDialog.Builder cevap = new Android.Support.V7.App.AlertDialog.Builder(GelenBase.Activity); cevap.SetIcon(Resource.Mipmap.ic_launcher_round); cevap.SetTitle(Spannla(Color.Black, "Buptis")); cevap.SetMessage(Spannla(Color.DarkGray, "Fotoğrafı silmek istediğinizden emin misiniz?")); cevap.SetPositiveButton("Evet", delegate { cevap.Dispose(); PrivateProfileGaleriVeResim DTO = mDataModel[(int)v.Tag]; WebService webService = new WebService(); var Donus = webService.ServisIslem("images/" + DTO.id, "", Method: "DELETE"); if (Donus != "Hata") { var positionn = mDataModel.FindIndex(item => item.id == DTO.id); removeAt(positionn); } }); cevap.SetNegativeButton("Hayır", delegate { cevap.Dispose(); }); cevap.Show(); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var root = inflater.Inflate(Resource.Layout.fragment_friends, container, false); var friendGrid = root.FindViewById <GridView> (Resource.Id.grid); friendGrid.ItemClick += FriendClicked; friendGrid.Adapter = new FriendAdapter(Activity, viewModel); friendGrid.LongClickable = true; friendGrid.ItemLongClick += (sender, e) => { var friend = viewModel.Friends[e.Position]; viewModel.ExecuteFlagFriendCommand(friend.FriendId, friend.Name); }; var fab = root.FindViewById <FloatingActionButton> (Resource.Id.fab); fab.AttachToListView(friendGrid); fab.Click += (sender, e) => { var builder = new Android.Support.V7.App.AlertDialog.Builder(Activity); builder.SetTitle(Resource.String.add_friend) .SetItems(new [] { Resources.GetString(Resource.String.add_by_email), Resources.GetString(Resource.String.pick_contact) }, this); builder.Create().Show(); }; refresher = root.FindViewById <SwipeRefreshLayout> (Resource.Id.refresher); refresher.Refresh += (sender, e) => viewModel.ExecuteLoadFriendsCommand(); return(root); }
private void showInputDialog() { LayoutInflater layoutInflater = LayoutInflater.From(this); View view = layoutInflater.Inflate(Resource.Layout.InputDialog, null); Android.Support.V7.App.AlertDialog.Builder alertbuilder = new Android.Support.V7.App.AlertDialog.Builder(this); alertbuilder.SetView(view); var userdata = view.FindViewById <EditText>(Resource.Id.editText); alertbuilder.SetCancelable(false) .SetPositiveButton("Choose", delegate { username = userdata.Text; preferences.Edit().PutString("username", username).Apply(); canvasView.Invalidate(); }) .SetNegativeButton("Cancel", delegate { alertbuilder.Dispose(); }); Android.Support.V7.App.AlertDialog dialog = alertbuilder.Create(); dialog.Show(); }
private void ShowStartDialog(ISharedPreferences prefs) { LayoutInflater layoutInflater = LayoutInflater.From(this); View view = layoutInflater.Inflate(Resource.Layout.hostname_input_box, null); Android.Support.V7.App.AlertDialog.Builder alertBuilder = new Android.Support.V7.App.AlertDialog.Builder(this); alertBuilder.SetView(view); var hostTextbox = view.FindViewById <EditText>(Resource.Id.hostnameText); var portTextbox = view.FindViewById <EditText>(Resource.Id.portText); alertBuilder.SetCancelable(true) .SetPositiveButton("Submit", delegate { hostname = hostTextbox.Text; port = portTextbox.Text; }).SetNegativeButton("Cancel", delegate { hostname = defaultHostname; port = defaultPort; }); Android.Support.V7.App.AlertDialog dialog = alertBuilder.Create(); dialog.Show(); var editor = prefs.Edit(); // add the hostname into the preferences editor.PutString("hostname", hostname); editor.PutString("port", port); // add a boolean tag editor.PutBoolean("firststart", false); editor.Apply(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.main); // this.SetupToolbar(true); // if (!UserPreferences.ShowWelcomeTip) { var dlg = new Android.Support.V7.App.AlertDialog.Builder(this) .SetTitle("Welcome") .SetMessage(Resource.String.WelcomeMessage) .SetPositiveButton("Thanks", delegate { }) .Show(); dlg.DismissEvent += delegate { UserPreferences.ShowWelcomeTip = true; }; } // lbNoSearchResults = FindViewById <TextView>(Resource.Id.lb_no_search_results); // foreach (var item in DisplayItems) { item.BindView(this).Click += delegate { StartActivity(item.ActivityType); } } ; }
private void ShowAlert(string errorMessage) { try { //set alert for executing the task alert = new Android.Support.V7.App.AlertDialog.Builder(Activity); alert.SetMessage(errorMessage); alert.SetCancelable(false); alert.SetPositiveButton("Ok", (senderAlert, args) => { _studentDetailsAdapter._studentList.RemoveAt(itemPosition); _studentDetailsAdapter.NotifyItemRemoved(itemPosition); }); alert.Show(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
protected override void OnCreate(Bundle savedInstanceState) { CrossNFC.Init(this); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.login); ComponentLocalizer(); ActionHooker(); NfcAdapter nfcAdapter = NfcAdapter.GetDefaultAdapter(this); if (nfcAdapter == null) { Android.Support.V7.App.AlertDialog.Builder alertDialog = new Android.Support.V7.App.AlertDialog.Builder(this); alertDialog.SetTitle(GetString(Resource.String.noNFC)); alertDialog.SetIcon(Resource.Drawable.ic1c_192x192); alertDialog.SetMessage(GetString(Resource.String.noSupport)); alertDialog.SetCancelable(false); alertDialog.SetNeutralButton(GetString(Resource.String.exit), delegate { Finish(); }); alertDialog.Show(); } CreateNotificationChannel(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it Button button = FindViewById <Button>(Resource.Id.myButton); button.Click += async delegate { progress = new ProgressDialog(this) { Indeterminate = true }; progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner); progress.SetMessage("Carregando informações do tempo..."); progress.SetCancelable(false); progress.Show(); var _api = new WeatherAPI(); var currentWeather = await _api.GetWeather(); Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this); progress.Dismiss(); alert.SetTitle("Aviso sobre o tempo"); alert.SetMessage($"a temperatura atual é: {Math.Round(currentWeather.TempInCelsius, 0).ToString()}"); alert.SetPositiveButton("OK", (sender, e) => { }); Dialog dialog = alert.Create(); dialog.Show(); }; }
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data) { if (requestCode == SystemFolderPickerId) { if ((resultCode == Result.Ok) && (data != null)) { try { var path = FilePathHelper.GetPathForDocTree(this, data.Data); ApplyReceiveLocationPathUpdate(path); } catch (NonPrimaryExternalStorageNotSupportedException) { var alert = new Android.Support.V7.App.AlertDialog.Builder(this) .SetTitle("Receiving to SD Card is not currently supported.") .SetMessage("This will be added in a future version.") .SetPositiveButton("Ok", (s, e) => { }); RunOnUiThread(() => { alert.Show(); }); return; } } } else if (requestCode == CustomFolderPickerId) { if ((resultCode == Result.Ok) && (data != null)) { var path = Utils.GetSelectedFilesFromResult(data).Select(x => Utils.GetFileForUri(x).AbsolutePath).First(); ApplyReceiveLocationPathUpdate(path); } } }
void Dialog(string title, string msg) { var builder = new Android.Support.V7.App.AlertDialog.Builder((AppCompatActivity)this.Activity, Resource.Style.DarkThemeDialog); builder.SetTitle(title); builder.SetMessage(msg); builder.SetPositiveButton(GetString(Resource.String.Dialog_Positive), (EventHandler <DialogClickEventArgs>)null); builder.SetNegativeButton(GetString(Resource.String.Dialog_Negative), (EventHandler <DialogClickEventArgs>)null); var dialog = builder.Create(); dialog.Show(); var PositiveButton = dialog.GetButton((int)DialogButtonType.Positive); PositiveButton.Click += delegate { dialog.Cancel(); }; var NegativeButton = dialog.GetButton((int)DialogButtonType.Positive); NegativeButton.Click += delegate { dialog.Cancel(); }; }
/// <summary> /// Gets the location compat async. /// </summary> /// <returns>The location compat async.</returns> async Task GetLocationCompatAsync() { const string permission = Manifest.Permission.AccessFineLocation; if (ContextCompat.CheckSelfPermission(this, permission) == (int)Permission.Granted) { return; } if (ActivityCompat.ShouldShowRequestPermissionRationale(this, permission)) { var dialog = new Android.Support.V7.App.AlertDialog.Builder(this) .SetTitle("Acción requerida") .SetMessage("Esta aplicación necesita acceso a la localización del dispositivo") .SetPositiveButton("Aceptar", (senderAlert, args) => { RequestPermissions(PermissionsLocation, RequestLocationId); }) .Show(); return; } RequestPermissions(PermissionsLocation, RequestLocationId); }
private void DonorsAdapter_MailClick(object sender, UserAdapterClickEventArgs e) { var donor = listOfDonors[e.Position]; Android.Support.V7.App.AlertDialog.Builder MailAlert = new Android.Support.V7.App.AlertDialog.Builder(this); MailAlert.SetMessage("Send Mail to " + donor.Fullname); MailAlert.SetPositiveButton("Send", (alert, args) => { Intent intent = new Intent(); intent.SetType("plain/text"); intent.SetAction(Intent.ActionSend); intent.PutExtra(Intent.ExtraEmail, new string[] { donor.Email }); intent.PutExtra(Intent.ExtraSubject, new string[] { "Enter your message here." }); StartActivity(intent); }); MailAlert.SetNegativeButton("Cancel", (alert, args) => { MailAlert.Dispose(); }); MailAlert.Show(); }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case Resource.Id.action_add: edtBookName = new EditText(this); Android.Support.V7.App.AlertDialog alertDialog = new Android.Support.V7.App.AlertDialog.Builder(this) .SetTitle("Add New Book") .SetView(edtBookName) .SetPositiveButton("Add", OkAction) .SetNegativeButton("Cancel", CancelAction) .Create(); alertDialog.Show(); return(true); case Resource.Id.action_cancel: string autlst = Intent.GetStringExtra("AuthorListdata") ?? "data not available"; AuthorListInBook = JsonConvert.DeserializeObject <DataBase>(autlst); Intent intent = new Intent(this, typeof(MainActivity)); CurrentAut.AuthorBook = book; CurrentAutToActivity = CurrentAut; UpdateList(CurrentAutToActivity, AuthorListInBook); intent.PutExtra("AuthorListdata", JsonConvert.SerializeObject(AuthorListInBook)); StartActivity(intent); Finish(); return(true); } return(base.OnOptionsItemSelected(item)); }
private void ShowAddEditDialog(CentralUnit centralUnit) { var builder = new Android.Support.V7.App.AlertDialog.Builder(this); var dialogView = LayoutInflater.Inflate(Resource.Layout.AddHomeControlSystemDialog, null); builder.SetView(dialogView); builder.SetNeutralButton(Android.Resource.String.Cancel, (sender, e) => { }); builder.SetPositiveButton(Android.Resource.String.Ok, (e, s) => App.Bootstrapper.SettingsViewModel.AddCentralUnitCommand.Execute(null)); // Bindings EtName = dialogView.FindViewById <EditText>(Resource.Id.etName); EtNameBinding = this.SetBinding(() => SettingsViewModel.NewCentralUnitName, () => EtName.Text, BindingMode.TwoWay); EtIpAddress = dialogView.FindViewById <EditText>(Resource.Id.etIpAddress); EtIpAddressBinding = this.SetBinding(() => SettingsViewModel.NewCentralUnitAddress, () => EtIpAddress.Text, BindingMode.TwoWay); // Fill spinner var items = Enum.GetValues(typeof(CentralUnitBrand)).OfType <object>().Select(s => s.ToString()).ToArray(); var spinnerAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, items); spinnerAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); dialogView.FindViewById <Spinner>(Resource.Id.spBrand).Adapter = spinnerAdapter; builder.Show(); }
public async Task DeleteDrop(int id) { var droplets = await GetServerInfo(); Android.Support.V7.App.AlertDialog.Builder deletepopup = new Android.Support.V7.App.AlertDialog.Builder(this); deletepopup.SetTitle("Warning"); deletepopup.SetCancelable(false); deletepopup.SetMessage("This cannot be undone\nAre you sure?"); deletepopup.SetNegativeButton("Cancel", (senderAlert, args) => { Toast.MakeText(this, "Cancelled!", ToastLength.Short).Show(); }); deletepopup.SetPositiveButton("OK", async(senderAlert, args) => { var trans = SupportFragmentManager.BeginTransaction(); trans.Show(_Loading_Fragment); trans.Hide(_droplet_Mainfragment); trans.Commit(); try { await client.Droplets.Delete(droplets[id].Id); } catch (Exception err) { Toast.MakeText(this, err.ToString(), ToastLength.Long).Show(); } trans = SupportFragmentManager.BeginTransaction(); trans.Hide(_Loading_Fragment); trans.Show(_droplet_Mainfragment); trans.Commit(); StartUpdate(-1); }); deletepopup.Show(); }
public override bool OnOptionsItemSelected(IMenuItem item) { int id = item.ItemId; switch (id) { case Resource.Id.action_start_private_chat: m_tabs.GetTabAt(1).Select(); break; case Resource.Id.action_start_group_chat: var buider = new Android.Support.V7.App.AlertDialog.Builder(this); buider.SetTitle("选择联系人"); var names = DataProvider.GetAllFriends(AppConfig.Instance.CurrentUser).ConvertAll((input) => { return(input.Name); }); var select = new List <UserInfo>(); buider.SetMultiChoiceItems(names.ToArray(), new bool[names.Count], (sender, e) => { IDialogInterface dialog = sender as IDialogInterface; if (dialog != null) { } }); buider.SetPositiveButton(GetString(Resource.String.confirm), (sender, e) => { }); buider.Show(); break; case Resource.Id.action_logout: Intent intent = new Intent(this, typeof(LoginActivity)); StartActivity(intent); Finish(); break; } return(true); }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); this.Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); // Set view layout SetContentView(Resource.Layout.Track); SetControls(); SetHandlers(); var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); var title = FindViewById <TextView>(Resource.Id.toolbar_title); //title.Text = GetString(Resource.String.Tracks_title); title.Text = string.Empty; string track = Intent.GetStringExtra("track"); title.Text = track; int records = await Request(track); if (records == 0) { Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this); alert.SetTitle(GetString(Resource.String.Confirm_title_records)); alert.SetMessage(GetString(Resource.String.Confirm_message_records)); alert.SetPositiveButton(GetString(Resource.String.Btn_OK), (senderAlert, args) => { base.OnBackPressed(); }); Dialog dialog = alert.Create(); dialog.Show(); } }
private void AddPlaylistClicked(object sender, EventArgs eventArgs) { LayoutInflater layoutInflater = LayoutInflater.From(this); View view = layoutInflater.Inflate(Resource.Layout.addSongToPlaylistDialog, null); var adapter = new SongsAdapter(_artistsViewModel.GetSongs()); adapter._itemClick += OnItemClick; var recyclerview = view.FindViewById <RecyclerView>(Resource.Id.addSongsToPlaylist); recyclerview.SetLayoutManager(new LinearLayoutManager(this)); recyclerview.SetItemAnimator(new DefaultItemAnimator()); recyclerview.SetAdapter(adapter); Android.Support.V7.App.AlertDialog.Builder alertbuilder = new Android.Support.V7.App.AlertDialog.Builder(this); alertbuilder.SetView(view); alertbuilder.SetCancelable(false) .SetNegativeButton("Cancel", delegate { alertbuilder.Dispose(); }); _dialog = alertbuilder.Create(); _dialog.Show(); }
private async void ViewSession(int position) { LayoutInflater layoutInflater = LayoutInflater.From(context); View mView = layoutInflater.Inflate(Resource.Layout.ProgressLayout, null); //mView.SetBackgroundColor(Color.Transparent); Android.Support.V7.App.AlertDialog.Builder alertProgress = new Android.Support.V7.App.AlertDialog.Builder(context); alertProgress.SetView(mView).SetCancelable(false); var alert = alertProgress.Show(); Session sessionObj = new Session(); try { var firebase = new FirebaseClient("https://leapproject-b603d.firebaseio.com/"); var items = await firebase.Child("Session").OnceAsync <Session>(); if (items.Count < 1) { alert.Dismiss(); Toast.MakeText(context, "Please Check the Internet Connection and Try Again.", ToastLength.Short).Show(); } foreach (var item in items) { if (item.Object.Session_Name == array[position]) { sessionObj = item.Object; alert.Dismiss(); displaySessionDetails(sessionObj); } } } catch (Exception) { Toast.MakeText(context, "Couldn't Sync the Firebase Data", ToastLength.Short).Show(); } }
protected void onCreateClick(object sender, EventArgs e) { ChatClientHub chatHub = new ChatClientHub(this.signalRURL); chatHub.CreateChat((bool ok) => { if (ok) { this.Finish(); } else { RunOnUiThread(() => { Android.Support.V7.App.AlertDialog.Builder builder; builder = new Android.Support.V7.App.AlertDialog.Builder(this); builder.SetTitle("Erro"); builder.SetMessage("Nome de Chat já existente!"); builder.SetCancelable(false); builder.SetPositiveButton("OK", delegate { }); builder.Show(); }); } }, this.currentUser.Username, this._txtChatName.Text, Convert.ToInt32(this._txtCapacity.Text)); }
public void CheckPermission(string[] xPermissions) { foreach (var perm in xPermissions) { if (ContextCompat.CheckSelfPermission(this, perm) == (int)Permission.Granted) { textView.Text = "PERMISSION ACEPT"; } else { ActivityCompat.ShouldShowRequestPermissionRationale(this, perm); var requiredPermissions = new String[] { perm }; var dialog = new Android.Support.V7.App.AlertDialog.Builder(this) .SetTitle("title") .SetMessage("msg") .SetPositiveButton("ok", (s, e) => { ActivityCompat.RequestPermissions(this, requiredPermissions, 0); }) .SetCancelable(false); dialog.Show(); } } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource: SetContentView(Resource.Layout.Main); // Get our RecyclerView layout: mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView_MainActivity); //............................................................ // Layout Manager Setup: // Use the built-in linear layout manager: mLayoutManager = new LinearLayoutManager(this); // Or use the built-in grid layout manager (two horizontal rows): //mLayoutManager = new GridLayoutManager // (this, 2, GridLayoutManager.Horizontal, false); // Plug the layout manager into the RecyclerView: mRecyclerView.SetLayoutManager(mLayoutManager); //............................................................ // Adapter Setup: // Create an adapter for the RecyclerView, and pass it the // data set (List<newsobject) to manage: mAdapter = new NewsObject_RecycleAdapter(newsObjectDisplayList); //Register the item click handler(below) with the adapter: mAdapter.ItemClick += MAdapter_ItemClick1; // Plug the adapter into the RecyclerView: mRecyclerView.SetAdapter(mAdapter); //----------------------------------- //----------------------------------- // ToolBar - Top of Screen (method 1) var toolbar = FindViewById <Toolbar>(Resource.Id.mainActivity_top_toolbar); SetSupportActionBar(toolbar); SupportActionBar.Title = GetString(Resource.String.mainActivity_top_toolbar_title); // Toolbar - Bottom of Screen (method 2) var toolbar_bottom = FindViewById <Toolbar>(Resource.Id.mainActivity_bottom_toolbar); toolbar_bottom.Title = GetString(Resource.String.mainActivity_bottom_toolbar_title); toolbar_bottom.InflateMenu(Resource.Menu.mainActivity_bottomMenu); // variables - bottom toolbar - alert dialog - market impact string[] marketImpact_titlesArray = Resources.GetStringArray(Resource.Array.MarketImpactArray); bool[] marketImpact_selectedBoolArray = new bool[marketImpact_titlesArray.Length]; // for selected checkboxes in MultiItemSelect // variables - bottom toolbar - alert dialog - currencies string[] currencies_titlesArray = Resources.GetStringArray(Resource.Array.CurrenciesArray); bool[] currencies_selectedBoolArray = new bool[currencies_titlesArray.Length]; // for selected checkboxes in MultiItemSelect // SQL only creates a new table if one doesn't already exist - it won't overwrite an existing table (?) DataAccessHelpers.CreateEmptyTable(); // set up table to store url for xml data download DataAccessHelpers.CreateTableForURLDownload(); // Display for last time data was updated - retrieved from Shared Preferences txtDataLastUpdated = FindViewById <TextView>(Resource.Id.mainActivity_txt_dataLastUpdated); RefreshTxtDataLastUpdated(); txtDataLastUpdated.Text += "\n " + GetString(Resource.String.mainActivity_txt_dataLastUpdated_pleaseSelectData); // Display all currency data (if any) from database. // This is needed here because onCreate() is called when MainActivity // is selected from a menu option (intent) in UserAlertsActivity. // - Not needed or called if the user selects onBackPress() GetAndDisplayDefaultData(); // for test data only------------------------------------------------------------ // Get testdata from xml file in Assets folder XDocument xmlTestDataFile = XDocument.Load(Assets.Open("ff_calendar_thisweek.xml")); // assign xml data file from Asset directory TO SetupData Property DataAccessHelpers.XmlTestDataFile = xmlTestDataFile; //-------------------------------------------------------------------------------- if (TimeOffsetUpdated == false) { Log.Debug("DEBUG_MainActivity_OnCreate", "\n\n\nTime offset has NOT been updated\n\n\n"); } if (TimeOffsetUpdated == true) { Log.Debug("DEBUG_MainActivity_OnCreate", "\n\n\nSUCCESS - Time offset HAS been updated\n\n\n"); //Toast.MakeText(this, GetString(Resource.String.mainActivity_txt_timeOffset_successMessage), ToastLength.Long).Show(); UpdateXML_Option(); // reset property for reuse on next occasion TimeOffsetUpdated = false; } //---------------------------------------------------- // bottom ToolBar Menu Selection toolbar_bottom.MenuItemClick += (sender, e) => { switch (e.Item.ItemId) { case Resource.Id.mainActivity_bottom_toolbar_option_ClearCurrencyData: // clear MarketImpacts & Currencies checkboxes - List<bool>'s, List<string>'s & adapter Array.Clear(marketImpact_selectedBoolArray, 0, marketImpact_selectedBoolArray.Length); Array.Clear(currencies_selectedBoolArray, 0, currencies_selectedBoolArray.Length); marketImpact_selectedList.Clear(); currencies_selectedList.Clear(); RefreshTxtDataLastUpdated(); txtDataLastUpdated.Text += "\n " + GetString(Resource.String.mainActivity_txt_dataLastUpdated_clearOptionSelected); tempNewsObjectDisplayList.Clear(); PopulateNewsObjectAdapter(); break; case Resource.Id.mainActivity_bottom_toolbar_option_displayAllCurrencyData: GetAndDisplayDefaultData(); break; case Resource.Id.mainActivity_bottom_toolbar_option_selectCurrencies: using (var dialog = new Android.Support.V7.App.AlertDialog.Builder(this)) { dialog.SetTitle(GetString(Resource.String.mainActivity_dialogOption_selectCurrencies)); dialog.SetPositiveButton(GetString(Resource.String.mainActivity_dialogOption_selectCurrencies_positiveButton), delegate { // clear list - get LINQ query result - populate list tempNewsObjectDisplayList.Clear(); tempNewsObjectDisplayList = DataAccessHelpers.LINQ_SortAllByUserSelection(marketImpact_selectedList, currencies_selectedList); // call populate adapter PopulateNewsObjectAdapter(); RefreshTxtDataLastUpdated(); DebugDisplayCurrencies(); }); // Set Multichoice Items dialog.SetMultiChoiceItems(currencies_titlesArray, currencies_selectedBoolArray, (s, eEXtra) => { int index = eEXtra.Which; bool isChecked = eEXtra.IsChecked; currencies_selectedBoolArray[index] = isChecked; // add item to list if now selected - ie isChecked is now TRUE if (isChecked) { currencies_selectedList.Add(currencies_titlesArray[index]); currencies_selectedBoolArray[index] = true; } else { currencies_selectedList.Remove(currencies_titlesArray[index]); currencies_selectedBoolArray[index] = false; } }); // check all boxes and add all items to list(s) dialog.SetNeutralButton(GetString(Resource.String.mainActivity_dialogOption_selectCurrencies_neutralButton), delegate { // clear list 1st to avoid getting duplicate entries currencies_selectedList.Clear(); // set all items in bool[] selected to TRUE for (int i = 0; i < currencies_selectedBoolArray.Length; i++) { currencies_selectedBoolArray[i] = true; currencies_selectedList.Add(currencies_titlesArray[i]); } // clear list & adapter - get LINQ query result - populate list tempNewsObjectDisplayList.Clear(); tempNewsObjectDisplayList = DataAccessHelpers.LINQ_SortAllByUserSelection(marketImpact_selectedList, currencies_selectedList); // call populate adapter PopulateNewsObjectAdapter(); DebugDisplayCurrencies(); }); // deselect all boxes & clear list dialog.SetNegativeButton(GetString(Resource.String.mainActivity_dialogOption_selectCurrencies_negativeButton), delegate { currencies_selectedList.Clear(); // clear bool[] set all items to FALSE for (int i = 0; i < currencies_selectedBoolArray.Length; i++) { currencies_selectedBoolArray[i] = false; currencies_selectedList.Remove(currencies_titlesArray[i]); } // clear list & adapter tempNewsObjectDisplayList.Clear(); PopulateNewsObjectAdapter(); DebugDisplayCurrencies(); }); dialog.Show(); } break; case Resource.Id.mainActivity_bottom_toolbar_option_debugDisplay: // displays contents of currency & marketImpact list in the Debug Output window Log.Debug("DEBUG_MainActivity", ": Currency & Market Impact Selected Display - Starts Here"); foreach (var item in currencies_selectedList) { Log.Debug("DEBUG", item); } foreach (var item in marketImpact_selectedList) { Log.Debug("DEBUG", item); } break; case Resource.Id.mainActivity_bottom_toolbar_option_selectMarketImpacts: using (var dialog = new Android.Support.V7.App.AlertDialog.Builder(this)) { dialog.SetTitle(GetString(Resource.String.mainActivity_dialogOption_selectmarketimpacts)); dialog.SetPositiveButton(GetString(Resource.String.mainActivity_dialogOption_selectmarketimpacts_positiveButton), delegate { // clear list - get LINQ query result - populate list tempNewsObjectDisplayList.Clear(); tempNewsObjectDisplayList = DataAccessHelpers.LINQ_SortAllByUserSelection(marketImpact_selectedList, currencies_selectedList); // call populate adapter PopulateNewsObjectAdapter(); RefreshTxtDataLastUpdated(); DebugDisplayMarketImpacts(); }); // Set Multichoice Items dialog.SetMultiChoiceItems(marketImpact_titlesArray, marketImpact_selectedBoolArray, (sender2, event2) => { int index = event2.Which; bool isChecked = event2.IsChecked; marketImpact_selectedBoolArray[index] = isChecked; // add item to list if now selected - ie isChecked is now TRUE if (isChecked) { marketImpact_selectedList.Add(marketImpact_titlesArray[index]); } else { marketImpact_selectedList.Remove(marketImpact_titlesArray[index]); } }); dialog.Show(); } break; //// old - not in use anymore - for demonstration purposes //case Resource.Id.mainActivity_bottom_toolbar_option_sampleData: // // get sample data (from xml file in assets folder) & pass to method // XDocument xmlTestFile2 = XDocument.Load(Assets.Open("ff_calendar_thisweek.xml")); // tempNewsObjectDisplayList.Clear(); // tempNewsObjectDisplayList = DataAccessHelpers.TestXMLDataFromAssetsFile(xmlTestFile2); // // call populate adapter // PopulateNewsObjectAdapter(); // txtDataLastUpdated.Text = GetString(Resource.String.mainActivity_txt_dataLastUpdated_warningTestDataOnlyAll); // break; //// old - not in use anymore - for demonstration purposes //case Resource.Id.mainActivity_bottom_toolbar_option_sampleLinqQuery: // // get sample data (from xml file in assets folder) & pass to method & pass to LINQ query method // XDocument xmlTestFile1 = XDocument.Load(Assets.Open("ff_calendar_thisweek.xml")); // tempNewsObjectDisplayList.Clear(); // tempNewsObjectDisplayList = DataAccessHelpers.TestLINQQueryUsingXML(xmlTestFile1); // // call populate adapter // PopulateNewsObjectAdapter(); // txtDataLastUpdated.Text = GetString(Resource.String.mainActivity_txt_dataLastUpdated_WarningTestDataOnlyQuery); // break; default: break; } }; void DebugDisplayCurrencies() { // displays currency (selected) to debug output Log.Debug("DEBUG", ": Currencies Selected Display - Starts Here"); foreach (var item in currencies_selectedList) { Log.Debug("DEBUG_MainActivity_DisplayCurrencies", item); } } void DebugDisplayMarketImpacts() { // displays marketImpacts (selected) to debug output Log.Debug("DEBUG", ": Market Impacts Selected Display - Starts Here"); foreach (var item in marketImpact_selectedList) { Log.Debug("DEBUG_MainActivity_DisplayMarketImpacts", item); } } }// end onCreate
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); receiver = new NetworkBroadcastReceiver(this); receiver.SetListener(this); intentFilter = new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"); RegisterReceiver(receiver, intentFilter); tvNetworkNotification = (TextView)FindViewById(Resource.Id.network_notification); ConnectivityManager cm = (ConnectivityManager)this.GetSystemService(Context.ConnectivityService); if (cm.ActiveNetworkInfo == null) { var ad = new Android.Support.V7.App.AlertDialog.Builder(this); ad.SetTitle("No Connection"); ad.SetMessage("Looks like there's a problem with your network connection. Try again later."); ad.SetCancelable(false); ad.SetPositiveButton("OK", this); Android.Support.V7.App.AlertDialog dialog = ad.Create(); dialog.Show(); } else { MapFragment mapFragment = (MapFragment)FragmentManager.FindFragmentById(Resource.Id.googlemap); mapFragment.GetMapAsync(this); toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); // Deserialize the member object ISharedPreferences pref = GetSharedPreferences(GetString(Resource.String.PreferenceFileName), FileCreationMode.Private); var member = pref.GetString(GetString(Resource.String.PreferenceSavedMember), ""); user = JsonConvert.DeserializeObject <Member>(member); var profile = new ProfileDrawerItem(); profile.WithName(user.username); profile.WithIdentifier(100); headerResult = new AccountHeaderBuilder() .WithActivity(this) .WithHeaderBackground(Resource.Drawable.profilebackground) .WithSelectionListEnabledForSingleProfile(false) .AddProfiles(profile) .WithOnAccountHeaderListener(this) .WithSavedInstance(bundle) .Build(); var header = new PrimaryDrawerItem(); header.WithName(Resource.String.Drawer_Item_Trips); header.WithIcon(GoogleMaterial.Icon.GmdDirectionsCar); header.WithIdentifier(1); var logoutDrawer = new SecondaryDrawerItem(); logoutDrawer.WithName(Resource.String.Drawer_Item_Logout); logoutDrawer.WithIcon(GoogleMaterial.Icon.GmdSettingsPower); logoutDrawer.WithIdentifier(4); //create the drawer and remember the `Drawer` result object Drawer result = new DrawerBuilder() .WithActivity(this) .WithToolbar(toolbar) .WithAccountHeader(headerResult) .AddDrawerItems( header, new DividerDrawerItem(), logoutDrawer ) .WithOnDrawerItemClickListener(this) .Build(); originAutocompleteFragment = (PlaceAutocompleteFragment) FragmentManager.FindFragmentById(Resource.Id.place_autocomplete_origin_fragment); originAutocompleteFragment.SetHint("Enter the origin"); originAutocompleteFragment.PlaceSelected += OnOriginSelected; destAutocompleteFragment = (PlaceAutocompleteFragment) FragmentManager.FindFragmentById(Resource.Id.place_autocomplete_destination_fragment); destAutocompleteFragment.SetHint("Enter the destination"); destAutocompleteFragment.PlaceSelected += OnDestinationSelected; progress = new ProgressDialog(this); progress.Indeterminate = true; progress.SetProgressStyle(ProgressDialogStyle.Spinner); progress.SetMessage("Getting location..."); progress.SetCancelable(false); RunOnUiThread(() => { progress.Show(); }); // Request Update request locationManager = (LocationManager)GetSystemService(Context.LocationService); IList <string> providers = locationManager.AllProviders; Criteria criteria = new Criteria(); string bestProvider = locationManager.GetBestProvider(criteria, true); locationManager.RequestLocationUpdates(bestProvider, MIN_TIME, MIN_DISTANCE, this); } }
private RelativeLayout ListLayoutSetup() { RelativeLayout layout = (RelativeLayout)((LayoutInflater)BaseContext.GetSystemService(Context.LayoutInflaterService)).Inflate(Resource.Layout.list_layout, null); SwipeRefreshLayout refresher = layout.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefresher); outputContainer = layout.FindViewById <LinearLayout>(Resource.Id.outputContainer); outputContainer.LayoutTransition = new LayoutTransition(); listButtonsGrid = layout.FindViewById <GridLayout>(Resource.Id.listButtonsGrid); Button resetAllButton = layout.FindViewById <Button>(Resource.Id.resetAllButton); Button manualAdd = layout.FindViewById <Button>(Resource.Id.directAdd); OutputListLayoutReset(); refresher.Refresh += delegate { OutputListLayoutReset(); refresher.Refreshing = false; }; manualAdd.Click += delegate { var dateBuilder = new Android.Support.V7.App.AlertDialog.Builder(this); DatePicker datePicker = new DatePicker(this); dateBuilder.SetView(datePicker); dateBuilder.SetNegativeButton("Cancel", delegate { return; }); dateBuilder.SetPositiveButton("OK", delegate { var timeBuilder = new Android.Support.V7.App.AlertDialog.Builder(this); TimePicker timePicker = new TimePicker(this); timePicker.SetIs24HourView(new Java.Lang.Boolean(true)); timePicker.Hour = 0; timePicker.Minute = 0; timeBuilder.SetView(timePicker); timeBuilder.SetNegativeButton("Cancel", delegate { return; }); timeBuilder.SetPositiveButton("Save Time", /*async*/ delegate { Time t = new Time { SavedTime = new DateTime(datePicker.Year, datePicker.Month + 1, datePicker.DayOfMonth, timePicker.Hour, timePicker.Minute, 0), CreatedTime = DateTime.Now }; registeredTimesDB.Insert(t); /*if (currentUser == null) * return; * RegisteredTime t = new RegisteredTime { SavedTime = new DateTime(datePicker.Year, datePicker.Month + 1, datePicker.DayOfMonth, timePicker.Hour, timePicker.Minute, 0), TimeUserId = currentUser.Id, createdAt = DateTime.Now}; * await client.GetTable<RegisteredTime>().InsertAsync(t);*/ OutputListLayoutReset(); }); timeBuilder.Create().Show(); }); dateBuilder.Create().Show(); }; resetAllButton.Click += delegate { var alert = new Android.Support.V7.App.AlertDialog.Builder(this); alert.SetTitle("Confirmation"); alert.SetMessage("Do you really want to permanently delete ALL of the recorded times ? This action is not recoverable."); alert.SetPositiveButton("YES", /*async */ delegate { registeredTimesDB.DropTable <Time>(); registeredTimesDB.CreateTable <Time>(); /*if (currentUser == null) * return; * var table = await client.GetTable<RegisteredTime>().Where(t => t.TimeUserId == currentUser.Id).ToEnumerableAsync(); * * foreach (RegisteredTime t in table) * await client.GetTable<RegisteredTime>().DeleteAsync(t);*/ outputContainer.RemoveAllViews(); outputContainer.AddView(listButtonsGrid); resetAllButton.Enabled = false; }); alert.SetNegativeButton("NO", delegate { return; }); alert.Create().Show(); }; return(layout); }
private void loud_targetButton_Click(object sender, EventArgs e) { Android.Support.V7.App.AlertDialog alert = new Android.Support.V7.App.AlertDialog.Builder(this) .SetTitle("Set new target volume?") .SetMessage( "Press start and then talk as loud as you can until the timer finishes to set a new target volume!") .SetNegativeButton("Cancel", (arg1, arg2) => { }) .SetPositiveButton("Start!", (arg1, arg2) => { ThreadPool.QueueUserWorkItem(o => StartVolumeCountdown()); }) .Create(); alert.Show(); }
private void ShowChooseModeDialog() { if (reading) { reading = false; StopAction(); } Android.Support.V7.App.AlertDialog choice = new Android.Support.V7.App.AlertDialog.Builder(this) .SetTitle("Choose a mode!") .SetItems(names.ToArray(), this) .Create(); choice.Show(); }
private void StopAction(bool stopRec = true, bool popup = false) { RunOnUiThread(() => { modeLayouts[currentMode].Visibility = ViewStates.Gone; startBtn.Text = "Start!"; }); if (stopRec) audioManager.StopRecording(); if (!popup) return; Android.Net.Uri passedUri = Android.Net.Uri.FromFile(new Java.IO.File(AppData.TempRecording.Path)); Android.Support.V7.App.AlertDialog alert = new Android.Support.V7.App.AlertDialog.Builder(this) .SetTitle("Session complete!") .SetMessage("Would you like to listen to your speech?") .SetPositiveButton("Listen", (EventHandler<DialogClickEventArgs>) null) .SetNeutralButton("Share recording", (EventHandler<DialogClickEventArgs>) null) .SetNegativeButton("Close", (arg1, arg2) => { }) .Create(); alert.Show(); alert.GetButton((int) DialogButtonType.Positive).Click += (sender, e) => { Intent intent = new Intent(); intent.SetAction(Intent.ActionView); intent.SetDataAndType(passedUri, "audio/*"); StartActivity(intent); }; alert.GetButton((int) DialogButtonType.Neutral).Click += (sender, e) => { Intent intent = new Intent(); intent.SetAction(Intent.ActionSend); intent.SetType("audio/*"); intent.PutExtra(Intent.ExtraStream, passedUri); StartActivity(intent); }; }
public override Dialog OnCreateDialog(Bundle savedInstanceState) { var b_ = new Android.Support.V7.App.AlertDialog.Builder (Context); b_.SetItems (new string [] {"Unregister"}, (sender, ea) => { var b = new Android.Support.V7.App.AlertDialog.Builder (Context); b.SetMessage (string.Format ("Folder '{0}' will be unregistered.", folder)) .SetNegativeButton ("Cancel", (o, e) => {}) .SetPositiveButton ("Remove", (o, e) => { ApplicationModel.Instance.RemoveSearchPaths (folder); }); b.Show (); }); return b_.Create (); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var view = new ListView(this.Activity); Console.WriteLine("Max Listings: " + MaxListings + ", Weeks Old: " + WeeksOld); feedClient = new CLFeedClient(Query, MaxListings, WeeksOld); var connected = feedClient.GetAllPostingsAsync(); if (!connected) { var builder = new Android.Support.V7.App.AlertDialog.Builder(this.Activity); builder.SetTitle("No internet connection") .SetMessage("Please connect and try again") .SetPositiveButton("Ok", delegate { this.FragmentManager.PopBackStack(); }); builder.Create().Show(); } else { var progressDialog = ProgressDialog.Show(this.Activity, "Please wait...", "Loading listings...", true); progressDialog.SetCancelable(true); progressDialog.SetCanceledOnTouchOutside(false); progressDialog.SetOnCancelListener(this); new Thread(new ThreadStart(delegate { //HIDE PROGRESS DIALOG feedClient.asyncLoadingComplete += (object sender, EventArgs e) => { this.Activity.RunOnUiThread(() => { progressDialog.Hide(); }); Console.WriteLine("NUM POSTINGS: " + feedClient.postings.Count); feedAdapter = new FeedResultsAdapter(this.Activity, new System.Collections.ObjectModel.ObservableCollection <Models.Posting>(feedClient.postings)); this.Activity.RunOnUiThread(() => { view.Adapter = feedAdapter; }); }; feedClient.emptyPostingComplete += (object sender, EventArgs e) => { this.Activity.RunOnUiThread(() => progressDialog.Hide()); var builder = new Android.Support.V7.App.AlertDialog.Builder(this.Activity); builder.SetTitle("Error loading listings"); builder.SetMessage(String.Format("No listings found.{0}Try a different search", System.Environment.NewLine)); builder.SetPositiveButton("Ok", delegate { this.FragmentManager.PopBackStack(); }); this.Activity.RunOnUiThread(() => { builder.Create().Show(); }); }; })).Start(); } view.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => { var transaction = this.Activity.SupportFragmentManager.BeginTransaction(); PostingDetailsFragment postingDetailsFragment = new PostingDetailsFragment(); postingDetailsFragment.Posting = feedClient.postings[e.Position]; transaction.Replace(Resource.Id.frameLayout, postingDetailsFragment); transaction.AddToBackStack(null); transaction.Commit(); }; return(view); }
private void recordButton_Click(object sender, EventArgs e) { if (!recording) { recordButton.Text = "Stop recording!"; audioManager.StartRecording(recFile); recordButton.SetBackgroundResource(Resource.Drawable.recordButtonRed); } else { recordButton.Text = "Recording complete!"; audioManager.StopRecording(); recordButton.SetBackgroundResource(Resource.Drawable.recordButtonBlue); Android.Support.V7.App.AlertDialog alert = new Android.Support.V7.App.AlertDialog.Builder(this) .SetTitle("Recording complete!") .SetMessage("You completed a new voice entry about " + placeName + ". Would you like to try again or export this recording?") .SetNegativeButton("Restart", (EventHandler<DialogClickEventArgs>) null) .SetPositiveButton("Export", (s, args) => { ExportRecordings(); }) .Create(); alert.Show(); // A second alert dialogue, confirming the decision to restart Button negative = alert.GetButton((int) DialogButtonType.Negative); negative.Click += delegate { Android.Support.V7.App.AlertDialog.Builder confirm = new Android.Support.V7.App.AlertDialog.Builder(this); confirm.SetTitle("Are you sure?"); confirm.SetMessage("Restarting will wipe your current progress. Restart the scenario?"); confirm.SetPositiveButton("Restart", (senderAlert, confArgs) => { recordButton.Text = "Start recording!"; alert.Dismiss(); }); confirm.SetNegativeButton("Cancel", (senderAlert, confArgs) => { }); confirm.Show(); }; } recording = !recording; }
protected override void OnCreate(Bundle bundle) { try { base.OnCreate(bundle); SetContentView(Resource.Layout.Menu); mToolBar = FindViewById <SupportToolbar>(Resource.Id.toolbar1); mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); mLeftDrawer = FindViewById <ListView>(Resource.Id.left_drawer); SetSupportActionBar(mToolBar); mDrawerToggle = new MyActionBarDrawerToogle( this, mDrawerLayout, Resource.String.openDrawer, Resource.String.closeDrawer ); mDrawerLayout.SetDrawerListener(mDrawerToggle); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); mDrawerToggle.SyncState(); SupportActionBar.SetTitle(mBienvenidoResource); mListIems = new List <clsMenu>(); clsMenu objMenuMovimientos = new clsMenu("Consulta de Movimientos", Resource.Drawable.ic_consulta_movimiento); clsMenu objMenuTransferencias = new clsMenu("Transferencias", Resource.Drawable.ic_transferencia); clsMenu objMenuPagoServicios = new clsMenu("Pago Servicios", Resource.Drawable.ic_pago_servicios); clsMenu objMenuPagoTarjeras = new clsMenu("Pago Tarjetas", Resource.Drawable.ic_pago_tarjetas); clsMenu objMenuAgregarCuenta = new clsMenu("Agregar Cuenta", Resource.Drawable.ic_agregar_cuenta); clsMenu objMenuSalir = new clsMenu("Salir", Resource.Drawable.ic_salir); mListIems.Add(objMenuMovimientos); mListIems.Add(objMenuTransferencias); mListIems.Add(objMenuPagoServicios); mListIems.Add(objMenuPagoTarjeras); mListIems.Add(objMenuAgregarCuenta); mListIems.Add(objMenuSalir); imageUrl = Intent.GetStringExtra(clsConstantes.strURLImagenUsuario); strIdentificacion = Intent.GetStringExtra(clsConstantes.strIdentificacionUsuario); strCuentaJson = Intent.GetStringExtra(clsConstantes.strCuentaJson); strIdUsuario = Intent.GetStringExtra(clsConstantes.strIdUsuario); strCooperativa = Intent.GetStringExtra(clsConstantes.strCooperativas); lstCooperativas = JsonConvert.DeserializeObject <List <clsCooperativa> >(strCooperativa); string[] arrRespuesta = strCuentaJson.Split('|'); string strCuentas = arrRespuesta[0]; string strTarjetas = arrRespuesta[1]; cuentasItems = JsonConvert.DeserializeObject <List <clsCuenta> >(strCuentas); tarjetasItems = JsonConvert.DeserializeObject <List <clsTarjetaCedito> >(strTarjetas); mArrayAdapter = new menu_adapter(this, mListIems); mLeftDrawer.Adapter = mArrayAdapter; mLeftDrawer.ItemClick += mLeftDrawer_ItemClick; //Llenar cuentas if (cuentasItems.Count > 0) { listViewCuentas = FindViewById <ListView>(Resource.Id.ListCuenta); listViewCuentas.Adapter = new cuentas_adapter(this, cuentasItems, lstCooperativas); listViewCuentas.ItemClick += OnListItemClickCuentas; // to be defined } //Llenar tarjetas if (tarjetasItems.Count > 0) { listViewTarjetas = FindViewById <ListView>(Resource.Id.ListTarjeta); listViewTarjetas.Adapter = new tarjetas_adapter(this, tarjetasItems); listViewTarjetas.ItemClick += OnListItemClickTarjetas; // to be defined } } catch (Exception ex) { Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this); alert.SetTitle("Alerta"); alert.SetMessage("Ocurió un problema con al abrir la pantalla"); RunOnUiThread(() => { alert.Show(); }); } }
private void mLeftDrawer_ItemClick(object sender, AdapterView.ItemClickEventArgs e) { int item = e.Position; if (item == 0) { var intent = new Intent(this, typeof(ActivitySeleccionCuenta)); intent.PutExtra(clsConstantes.strIdentificacionUsuario, strIdentificacion); intent.PutExtra(clsConstantes.strURLImagenUsuario, imageUrl); intent.PutExtra(clsConstantes.strIdUsuario, strIdUsuario); intent.PutExtra(clsConstantes.strCuentaJson, strCuentaJson); intent.PutExtra(clsConstantes.strCooperativas, strCooperativa); StartActivity(intent); this.Finish(); } else if (item == 1) { var intent = new Intent(this, typeof(ActivityTransferencia)); intent.PutExtra(clsConstantes.strIdentificacionUsuario, strIdentificacion); intent.PutExtra(clsConstantes.strURLImagenUsuario, imageUrl); intent.PutExtra(clsConstantes.strIdUsuario, strIdUsuario); intent.PutExtra(clsConstantes.strCuentaJson, strCuentaJson); intent.PutExtra(clsConstantes.strCooperativas, strCooperativa); StartActivity(intent); this.Finish(); } else if (item == 2) { var intent = new Intent(this, typeof(ActivityConsultaServicios)); intent.PutExtra(clsConstantes.strIdentificacionUsuario, strIdentificacion); intent.PutExtra(clsConstantes.strURLImagenUsuario, imageUrl); intent.PutExtra(clsConstantes.strIdUsuario, strIdUsuario); intent.PutExtra(clsConstantes.strCuentaJson, strCuentaJson); intent.PutExtra(clsConstantes.strCooperativas, strCooperativa); StartActivity(intent); this.Finish(); } else if (item == 3) { if (tarjetasItems.Count > 0) { var intent = new Intent(this, typeof(ActivityPagoTarjeta)); intent.PutExtra(clsConstantes.strIdentificacionUsuario, strIdentificacion); intent.PutExtra(clsConstantes.strURLImagenUsuario, imageUrl); intent.PutExtra(clsConstantes.strIdUsuario, strIdUsuario); intent.PutExtra(clsConstantes.strCuentaJson, strCuentaJson); intent.PutExtra(clsConstantes.strCooperativas, strCooperativa); StartActivity(intent); this.Finish(); } else { Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this); alert.SetTitle("Alerta"); alert.SetMessage("No dispone de tarjetas para el pago"); RunOnUiThread(() => { alert.Show(); }); } } else if (item == 4) { var intent = new Intent(this, typeof(ActivityAgregarCuenta)); intent.PutExtra(clsConstantes.strIdentificacionUsuario, strIdentificacion); intent.PutExtra(clsConstantes.strURLImagenUsuario, imageUrl); intent.PutExtra(clsConstantes.strIdUsuario, strIdUsuario); intent.PutExtra(clsConstantes.strCuentaJson, strCuentaJson); intent.PutExtra(clsConstantes.strCooperativas, strCooperativa); StartActivity(intent); this.Finish(); } else if (item == 5) { Android.OS.Process.KillProcess(Android.OS.Process.MyPid()); } }