tomy29 Posted May 31, 2010 Share Posted May 31, 2010 Bonjour, J'ai un soucis avec la mise à jour d'une listeview alimentée par un SQLite. Le code suivant : ListView lvIngr; ArrayList listIngr = new ArrayList(); MyListAdapter adp; lvIngr = (ListView)findViewById(R.id.lvingredient); adp = new MyListAdapter(this, listIngr); lvIngr.setAdapter(adp); listIngr.add(new Ingredient("beurre","1"); adp.notifyDataSetChanged(); Ma liste est bien mise à jour après l'ajout d'un ingrédient dans ma liste. Par contre si j'alimente ma liste avec SQlite : BaseAdapter baseAdapter = new BaseAdapter(this); baseAdapter.open(); baseAdapter.insertIngredient("beurre","1"); listIngr = baseAdapter.getAllIngredients(); adp.notifyDataSetChanged(); Ma listview n'est pas mise à jour. Avez-vous une explication? Merci! PS : ma fonction getAllIngredients retourne bien des ingrédients. Link to comment Share on other sites More sharing options...
tomy29 Posted May 31, 2010 Author Share Posted May 31, 2010 Avec un cursor adapter c'est plus facile. ;) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.