protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.PhoDetailView); //early demos //PhoDataService dataService = new PhoDataService (); //selectedPho = dataService.GetPhoById (1); //FindViews(); //BindData(); //------------------------------------------------------------------ //HandleEvents(); //navigation demos var selectedPhoId = Intent.Extras.GetInt("selectedPhoId"); dataService = new PhoDataService(); selectedPho = dataService.GetPhoById(selectedPhoId); FindViews(); BindData(); HandleEvents(); }
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data) { base.OnActivityResult(requestCode, resultCode, data); if (resultCode == Result.Ok && requestCode == 100) { var selectedPho = phoDataService.GetPhoById(data.GetIntExtra("selectedPhoId", 0)); var dialog = new AlertDialog.Builder(this); dialog.SetTitle("Confirmation"); dialog.SetMessage(string.Format("You've added {0} time(s) the {1}", data.GetIntExtra("amount", 0), selectedPho.Name)); dialog.Show(); } }