@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if(edconsulta.getText().toString().length() == 0 )
{
edconsulta.requestFocus();
edconsulta.setError("Campo No Puede Estar en Blanco.");
}
else if(edconsulta.getText().toString().length() > 0 && edconsulta.getText().toString().length() <= 10 )
{
String dni = (edconsulta.getText().toString());
Cursor c = db.rawQuery("SELECT * FROM Consulta where consu_cedula ="+dni, null);
if (c.moveToFirst()) {
do {
//Recorremos el cursor hasta que no haya más registros
String nombre = c.getString(0);
String cedula = c.getString(1);
String modelo = c.getString(2);
String banco = c.getString(3);
double precio = c.getDouble(4);
double seguro = c.getDouble(5);
double cuota = c.getDouble(6);
int plazo = c.getInt(7);
tx1.append(""+cedula);
} while(c.moveToNext());
//Toast toast = Toast.makeText(this, "Registro Existente"+cedula, Toast.LENGTH_SHORT);
//toast.setDuration(Toast.LENGTH_SHORT);
//toast.setGravity(Gravity.CENTER,0,0);
//toast.show();
bt2.setEnabled(true);
bt1.setEnabled(false);
dbHelper.cerrar();
}
}
else
{
tx1.setText("No hay nada");
}
}
});
}
管理员运行sql查询,但我不投票实现任何结果
点击部分匹配后不会给我任何结果。
我在app中创建了一个应用程序,用于onClickListner上的按钮。
请帮助..