Comme le dit le titre, ma listview ne sera pas remplie. Je sais que l'adaptateur est rempli avec 3 éléments, débogué mon chemin à travers elle. Mais mon xml ne montre rien du tout:android ListView n'est pas mis à jour
L'adaptateur est une variable globale si cela devrait faire n'importe quoi. code:
private void listChange(CustomCursor c){
List<SimpleListItem> itemsList = new ArrayList<SimpleListItem>();
while (c.moveToNext()) {
String picture = c.getString("picture");
String text = c.getString("name");
itemsList.add(new SimpleListItem(text, picture));
}
productListAdapter = new ProductAdapter(getBaseContext(),R.layout.product_item, itemsList);
setListAdapter(productListAdapter);
productListAdapter.notifyDataSetChanged();
}
XML de l'activité:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<dk.foo.views.PageHeaderView
android:id="@+id/header"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</dk.foo.views.PageHeaderView>
<ListView
android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</ListView>
</LinearLayout>
Ajoutez le fichier de mise en page complet dans lequel vous déclarez 'ListView'. – Luksprog
désolé erreur d'insertion de code stackoverflow;) –
Inclure le code source complet.qui aiderait –