public static bool OnOptionsItemSelected(IMenuItem item, AppCompatActivity activity, Action action = default) { if (action != null) { action.Invoke(); return(true); } switch (item.ItemId) { case TVScheduleId: activity.StartActivity(typeof(TVScheduleActivity)); break; case SearchId: activity.StartActivity(typeof(SearchActivity)); break; case GenresId: activity.StartActivity(typeof(GenresActivity)); break; case AboutId: activity.StartActivity(typeof(AboutActivity)); break; default: return(false); } return(true); }
public static void CallPhone(string phonenumber, AppCompatActivity activity) { var uri = Android.Net.Uri.Parse("tel:" + phonenumber); var intent = new Intent(Intent.ActionView, uri); activity.StartActivity(intent); }
public static void NavigateTo(this AppCompatActivity activity, Type type) { var intent = new Intent(activity, type); intent.SetFlags(ActivityFlags.NewTask); activity.StartActivity(intent); }
public static void NavigateToAndClearStack(this AppCompatActivity activity, Type type) { var intent = new Intent(activity, type); intent.SetFlags(ActivityFlags.NewTask | ActivityFlags.ClearTask); activity.StartActivity(intent); activity.Finish(); }
private void FoundImagesAdapter_ItemClick(object sender, FoundImagesAdapterClickEventArgs e) { var item = ImageFileNameModels.ElementAt(e.Position); //Send the full path in intent to the image activity. Intent intent = new Intent(context, typeof(ImageDetailActivity)) .PutExtra("filePath", item.FullPath); context.StartActivity(intent); }
public void OnItemClick(object sender, ItemClickEventArgs e) { DrawerPosition position = arrayList[e.Position].DrawerPosition; Intent nextActivity; switch (position) { case DrawerPosition.Perfil: nextActivity = new Intent(activity, typeof(ProfileActivity)); activity.StartActivity(nextActivity); break; case DrawerPosition.PendingOrders: nextActivity = new Intent(activity, typeof(PendingOrdersActivity)); activity.StartActivity(nextActivity); break; case DrawerPosition.Comissions: nextActivity = new Intent(activity, typeof(ComissionsActivity)); activity.StartActivity(nextActivity); break; } }
public void ShowDialog(String url) { Android.Support.V7.App.AlertDialog.Builder builder = new Android.Support.V7.App.AlertDialog.Builder(mActivity); View dialogView = LayoutInflater.From(mActivity).Inflate(Resource.Layout.polling_dialog, null); TextView linkView = dialogView.FindViewById <TextView>(Resource.Id.tv_link_redirect); linkView.SetText(Resource.String.verify); linkView.Click += (s, e) => { string action = Intent.ActionView; Intent browserIntent = new Intent(action, Android.Net.Uri.Parse(url)); mActivity.StartActivity(browserIntent); }; builder.SetView(dialogView); mAlertDialog = builder.Create(); mAlertDialog.Show(); }
private void NavigationView_NavigationItemSelected(object sender, NavigationView.NavigationItemSelectedEventArgs e) { switch (e.MenuItem.ItemId) { case Resource.Id.nav_home: _activity.StartActivity(new Intent(_activity, typeof(MainActivity))); _activity.Finish(); break; /*case Resource.Id.nav_trip: * _activity.StartActivity(new Intent(_activity, typeof(TripActivity))); * _activity.Finish(); * break; * case Resource.Id.nav_list: * _activity.StartActivity(new Intent(_activity, typeof(RegionListActivity))); * _activity.Finish(); * break; * case Resource.Id.nav_map: * _activity.StartActivity(new Intent(_activity, typeof(RegionMapActivity))); * _activity.Finish(); * break; * case Resource.Id.nav_database: * _activity.StartActivity(new Intent(_activity, typeof(DatabaseActivity))); * _activity.Finish(); * break; * case Resource.Id.nav_settings: * _activity.StartActivity(new Intent(_activity, typeof(SettingsActivity))); * _activity.Finish(); * break; * case Resource.Id.nav_logout: * UserDB.Clear(); * _activity.StartActivity(new Intent(_activity, typeof(LoginActivity))); * _activity.Finish(); * break;*/ } _drawerLayout.CloseDrawers(); }
public void OnItemClick(object sender, ItemClickEventArgs e) { DrawerPosition position = arrayList[e.Position].DrawerPosition; switch (position) { case DrawerPosition.NuevoMandado: Intent nuevo_mandado = new Intent(activity, typeof(InicioActivity)); activity.StartActivity(nuevo_mandado); break; case DrawerPosition.MisDirecciones: Intent direcciones = new Intent(activity, typeof(MisDireccionesActivity)); activity.StartActivity(direcciones); break; case DrawerPosition.Promociones: Intent promociones = new Intent(activity, typeof(PromocionesActivity)); activity.StartActivity(promociones); break; case DrawerPosition.MiCuenta: Intent micuenta = new Intent(activity, typeof(MiCuentaActivity)); activity.StartActivity(micuenta); break; case DrawerPosition.HistorialDeMandados: Intent historial_mandados = new Intent(activity, typeof(HistorialMandadoActivity)); activity.StartActivity(historial_mandados); break; case DrawerPosition.MandadosEnProceso: Intent mandados_proceso = new Intent(activity, typeof(MandadosProgresoActivity)); activity.StartActivity(mandados_proceso); break; } }
/// <summary> /// Ons the click. /// </summary> /// <param name="locationName">Location name.</param> void onClick(List <Object> locationName) { Intent intentAHomeAgregaProducto = new Intent(appCompatActivity, typeof(ProductosPendientesActivity)); appCompatActivity.StartActivity(intentAHomeAgregaProducto); }
public void setupToolbar(Toolbar _supporttoolbar, DrawerLayout _drawer, NavigationView _navigationview, int titleID, AppCompatActivity context) { ViewContext = context; _supporttoolbar.SetTitle(titleID); context.SetSupportActionBar(_supporttoolbar); _supporttoolbar.SetNavigationIcon(Resource.Drawable.ic_menu_white_24dp); context.SupportActionBar.SetDisplayHomeAsUpEnabled(false); ErrorHandler error = new ErrorHandler(context); _navigationview.NavigationItemSelected += (sender, e) => { switch (e.MenuItem.ItemId) { case Resource.Id.nav_recentEvents: { _drawer.CloseDrawer(GravityCompat.Start); var intent = new Intent(context, typeof(RecentEventsActivity)); context.StartActivity(intent); } break; case Resource.Id.nav_createEvent: { _drawer.CloseDrawer(GravityCompat.Start); var intent = new Intent(context, typeof(EventCreationActivity)); context.StartActivity(intent); } break; case Resource.Id.nav_deleteEvent: { _drawer.CloseDrawer(GravityCompat.Start); //switch to calendar view var intent = new Intent(context, typeof(EventDeletionActivity)); context.StartActivity(intent); } break; case Resource.Id.nav_calendar: { _drawer.CloseDrawer(GravityCompat.Start); //switch to calendar view var intent = new Intent(context, typeof(CalendarViewActivity)); context.StartActivity(intent); } break; case Resource.Id.nav_createEmployee: { _drawer.CloseDrawer(GravityCompat.Start); //switch to createEmployee view var intent = new Intent(context, typeof(CreateEmployeeActivity)); context.StartActivity(intent); } break; case Resource.Id.nav_overtime: { _drawer.CloseDrawer(GravityCompat.Start); //switch to overtime view var intent = new Intent(context, typeof(OvertimeActivity)); context.StartActivity(intent); } break; case Resource.Id.nav_filter: { _drawer.CloseDrawer(GravityCompat.Start); spawnFilterDialog(); } break; case Resource.Id.logoutitem: { _drawer.CloseDrawer(GravityCompat.Start); OnLogoutClicked(); var intent = new Intent(context, typeof(LoginActivity)); context.StartActivity(intent); } break; } }; }