は有線の問題で助けが必要です。私は、コードのこの部分がITEM_ID挿入され、ITEM_NAMEが完全に罰金アレイにAndroidのSQLite列の値が存在しない
item_id item_name
1 first
2 second
3 third
など
上を以下のようにSQLiteのテーブル項目を有しています。私は、それは例外
を通してそれをCustomCursorAdapterするために割り当てるときしかし、私は、Androidへの初心者です助けてください
「を 『最初の』列が存在しません」。引数として
CustomCursorAdapter ca = new CustomCursorAdapter(this,
android.R.layout.simple_list_item_1, c, from, to);
必要なカラム名でのパラメータからで
c = db.rawQuery("select item_id as _id, item_name from items", null);
int i = 0;
c.moveToFirst();
do {
from[i] = c.getString(1);
to[i] = c.getInt(0);
Log.i("item ", to[i] + " " + from[i]);
i++;
} while (c.moveToNext());
try {
CustomCursorAdapter ca = new CustomCursorAdapter(this,
android.R.layout.simple_list_item_1, c, from, to);
getListView().setAdapter(ca);
} catch (Exception e) {
Log.e("Ex ", e.getMessage()); // exception : column 'first' does not exists.
}