如何通过文本框中的光标显示检索到的数据..它给出了一个错误 “光标超出界限......”
Cursor c=mydb.rawquery("select * from customer where phone='"+editphone.getText().tostring+" ",null);
editname.settext(c.getString(0));
答案 0 :(得分:2)
在c.moveToFirst()
之前使用c.getString(0);
Cursor c=mydb.rawquery("select * from customer where phone='"+editphone.getText().tostring+" ",null);
if (c.moveToFirst()){
editname.settext(c.getString(0));
}