Androidプログラミング質問スレ Part23
■ このスレッドは過去ログ倉庫に格納されています
0645デフォルトの名無しさん
2012/07/11(水) 17:32:21.93sqliteのDBからデータを取得し、ListViewで表示すると言う処理を作っています。
データをカーソルに取り出すところまでは何の問題も無く行ったのですが、そこから先、何故か表示がうまくいきません。
悪さをしているのでは無いかと考えたものを徹底的に省いてみたのですが、それでもダメでした。
-- result_list.xml --
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"android:layout_height="fill_parent" >
<!-- リストのメイン -->
<ListView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/result_main" >
</ListView>
</RelativeLayout>
-- result_list_item.xml --
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/date" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_weight="1" android:width="0dp" >
</TextView>
-- リスト表示部 --
Cursor c = DBAdapter.getAllNotes(); // 内部でcursorを取得
SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this,
R.layout.result_list_item, c, new String[] {DBAdapter.COL_DATE}, new int[] { R.id.date});
lv.setAdapter(mAdapter);
中身これだけなのに表示されません。いったい何が誤りなのか、ご教示願えませんでしょうか。
■ このスレッドは過去ログ倉庫に格納されています