제목에서 알 수 있듯이 내 목록보기가 채워지지 않습니다. 나는 어댑터가 3 가지 항목으로 채워지고 있음을 알고 그것을 통해 디버깅했다. 하지만 내 XML 전혀 아무것도 게재되지 않습니다 :android ListView가 업데이트되지 않습니다
어댑터는 무엇이든해야 전역 변수입니다. 코드 : 활동의
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 : 당신이 ListView
를보고 싶다면
<?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>
'ListView'를 선언 한 전체 레이아웃 파일을 추가하십시오. – Luksprog
죄송 stackoverflow 코드 삽입 오류;) –
전체 소스 코드를 포함합니다. 도움이 될 –