TextView tv_list=(TextView)findViewById(R.id.list);
int
i=
0
;
try
{
DBManager dbmgr =
new
DBManager(
this
);
SQLiteDatabase sdb = dbmgr.getReadableDatabase();
Cursor cursor = sdb.rawQuery(
"select name,season,height,weight from my"
,
null
);
System.out.println(
"쿼리"
+sdb.rawQuery(
"select name,season,height,weight from my"
,
null
));
while
(cursor.moveToNext()){
String name = cursor.getString(
0
);
String season = cursor.getString(
1
);
String height = cursor.getString(
2
);
String weight = cursor.getString(
3
);
tv_list.append(name+
"\n"
);
tv_list.append(season+
"\n"
);
tv_list.append(height+
"\n"
);
tv_list.append(weight+
"\n"
);
i++;
}
cursor.close();
dbmgr.close();
}
catch
(SQLiteException e){
tv_list.append(
"DB 에러입니다."
);
}
if
(i ==
0
)
tv_list.append(
"저장된 정보가 없습니다.\n"
);
save = (Button)findViewById(R.id.save);
save.setOnClickListener(
this
);