2010-10-01から1ヶ月間の記事一覧

手動で追加した値をSimpleCursorAdapterで使う

デバッグとかのときとか、DB使いたくないとき用に。 ArrayAdapterを継承して新しいクラス作ってgetViewオーバーライドして値追加して…ってやるのはめんどくさい。 そこで、SimpleCursorAdapterの引数に使う、DBのクエリ結果を格納するCursorを擬似的に作成す…

SimpleCursorAdapterのAdapt先にsetTextなどをする値をいじる

前回はSimpleCursorAdapterを継承して新しいクラスを作ってたけど、listenerいらないならそこまでしなくても大丈夫。 main.xml <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="fill_parent" /> list_row.x…</listview>