protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); repo = ClientesApp.Repositorio; repo.inicializar(); //var repo = new MemoryClienteRepository(); string dbPath = System.IO.Path.Combine( System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "clientes.bd3"); repo = new SQLiteClienteRepository(dbPath); // 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 crearBt = FindViewById <Button>(Resource.Id.btnCrear); lv = FindViewById <ListView>(Resource.Id.listView1); var Cliente = repo.LeerCliente(); adapter = new ClienteLVAdapteter(this, Cliente); // var adapter = new ClienteLVAdapteter(this, Clientes); //lv.Adapter = adapter; crearBt.Click += CrearBt_Click; lv.ItemClick += Lv_ItemClick; }
protected override void OnResume() { base.OnResume(); if (lv != null) { var Cliente = repo.LeerCliente(); adapter = new ClienteLVAdapteter(this, Cliente); lv.Adapter = adapter; } }