protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); //SetContentView(Resource.Layout.CardMenuView); //cardMenuView = FindViewById<ListView>(Resource.Id.cardListView); // Get Data cardDataService = new CardsDataService(); this.allCards = cardDataService.GetAllCards(); // Use Adapter //cardMenuView.Adapter = new CardListAdapter(this, allCards); // Enable Fast Scroll //cardMenuView.FastScrollEnabled = true; ListView.Adapter = new CardListAdapter(this, allCards); ListView.FastScrollEnabled = true; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.CardDetailView); // Get data from User Selection on CardMenuActivity var id = Intent.Extras.GetInt("selectedCardId"); //var cardList = Intent.Extras.GetStringArrayList("Card") ?? new string[0]; //string _id = cardList[0]; //int id = int.Parse(_id); this.dataService = new CardsDataService(); this.selectedCard = dataService.GetCardById(id); //this.selectedCard = dataService.GetCardById(1); FindViews(); BindData(); HandleEvents(); }
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data) { base.OnActivityResult(requestCode, resultCode, data); int height = rayPictureImageView.Height; int width = rayPictureImageView.Width; imageBitmap = ImageHelper.GetImageBitmapFromFilePath(imageFile.Path, width, height); if (imageBitmap != null) { rayPictureImageView.SetImageBitmap(imageBitmap); var cardDataService = new CardsDataService(); cardDataService.AddCard(new Card() { filePath = this.fileName, bitmap = imageBitmap, file = this.imageFile, name = "New Card" }); imageBitmap = null; } //required to avoid memory leaks! GC.Collect(); }