它給我的錯誤。如何獲得所有的功能。感謝如何從sqlite檢索數據Android
show.setOnClickListener(new Button.OnClickListener() {
public void onClick(View arg0)
{
String mm = seg.getText().toString();
String mmm =ubs.getText().toString();
String mmmm=area.getText().toString();
String mmmmm= microarea.getText().toString();
String mmmmmm= imovel.getText().toString();
String query = (" SELECT * FROM DOMICIL WHERE "
+ " SEG ="+ mm
+ " And UNIDADE ="+mmm
+ " And AREA ="+mmmm
+ " And MICROAREA ="+mmmmm
+ " And IMOVEL ="+ mmmmmm);
Cursor c =my.rawQuery(query,null);
c.moveToFirst();
while(!c.isAfterLast())
{
int id = c.getInt(0);
seg.setText(c.getString(1));
ubs.setText(c.getString(2));
area.setText(c.getString(3));
microarea.setText(c.getString(4));
imovel.setText(c.getString(5));
numer_casa.setText(c.getString(6));
cep.setText(c.getString(7));
complemento.setText(c.getString(8));
c.moveToNext();
}
c.close();
}
});
}
它給出了哪個錯誤? –
您不應該從未經檢查的用戶輸入構建查詢 –