현재 디비 구현해서 데이터도 들어가는걸 확인해쓴데
이걸 꺼내오는게 문제입니다.
우선 이러한 코드로 데이터를 불러오면
for(int i = 0; i< itemIds.size(); i++)
System.out.println("itemid : "+itemIds.get(i));
itemid : 234
itemid : 341
itemid : 448
itemid : 555
itemid : 662
이런식으로 출력이 됩니다. 저 안에 있는 데이터를 가져와야되는데 데이터가 저장된 위치? 같은 숫자만 나오고 있습니다.
어떻게 하면 데이터를 가져올 수 있는건가요?
디비 구조는 이렇습니다.
public final class AssetListData {
// To prevent someone from accidentally instantiating the contract class,
// make the constructor private.
private AssetListData() {}
/* Inner class that defines the table contents */
public static class AssetEntry implements BaseColumns {
public static final String TABLE_NAME = "assets";
public static final String COLUMN_NAME_ASSETNUMBER = "asset_number";
public static final String COLUMN_NAME_ITEMNUMBER = "item_number";
public static final String COLUMN_NAME_PHONENAME = "phone_name";
public static final String COLUMN_NAME_STATUS = "status";
}
public static final String SQL_CREATE_ENTRIES =
"CREATE TABLE " + AssetEntry.TABLE_NAME + " (" +
AssetEntry._ID + " INTEGER PRIMARY KEY," +
AssetEntry.COLUMN_NAME_ASSETNUMBER + " TEXT," +
AssetEntry.COLUMN_NAME_ITEMNUMBER + " TEXT," +
AssetEntry.COLUMN_NAME_PHONENAME + " TEXT," +
AssetEntry.COLUMN_NAME_STATUS + " TEXT)";
public static final String SQL_DELETE_ENTRIES =
"DROP TABLE IF EXISTS " + AssetEntry.TABLE_NAME;
}