我必须使用他们的 id 从数据库中检索一个字符串。我完成了检索,但它以某种对象格式返回,而不是作为字符串。请帮助我..
我的检索地点:
db.open();
for(int i=1;i<=5;i++)
{
if(i==1)
group1=db.getspintitle(1);
if(i==2)
group1=db.getspintitle(2);
if(i==3)
group1=db.getspintitle(3);
if(i==4)
group1=db.getspintitle(4);
if(i==5)
group1=db.getspintitle(5);
}
db.getspintitle() 方法:
public String getspintitle(int rowId)throws SQLException
{
String sumtotal="";
Cursor cursor1 = db.rawQuery(
"SELECT spin from spinner WHERE _id='rowId'", null);
sumtotal=cursor1.toString();
cursor1.close();
return sumtotal;
}