When I want to ask a question, the program closes. I attach the code:
public void consulta (View v){
AdminSQLiteOpenHelper admin= new AdminSQLiteOpenHelper(this, "administracion", null, 1);
SQLiteDatabase BaseDeDatos=admin.getWritableDatabase();
String nombre=et2.getText().toString();
if(nombre.length()!=0){
Cursor fila=BaseDeDatos.rawQuery("SELECT nombre,codigo,precio,genero FROM articulos WHERE nombre="+ nombre ,null);
if (fila.moveToFirst()){
et2.setText(fila.getString(0));
et1.setText(fila.getString(1));
et4.setText(fila.getString(2));
et3.setText(fila.getString(3));
BaseDeDatos.close();
}else {
Toast.makeText(this, "No existe dicha persona", Toast.LENGTH_SHORT).show();
BaseDeDatos.close();
}
} else{
Toast.makeText(this, "campo vacio", Toast.LENGTH_SHORT).show();
}
}
Deputy LogCat: