Created
February 4, 2019 17:05
-
-
Save parzibyte/88009b630ba7100ee2f44c8f59476114 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int guardarCambios(Mascota mascotaEditada) { | |
SQLiteDatabase baseDeDatos = ayudanteBaseDeDatos.getWritableDatabase(); | |
ContentValues valoresParaActualizar = new ContentValues(); | |
valoresParaActualizar.put("nombre", mascotaEditada.getNombre()); | |
valoresParaActualizar.put("edad", mascotaEditada.getEdad()); | |
// where id... | |
String campoParaActualizar = "id = ?"; | |
// ... = idMascota | |
String[] argumentosParaActualizar = {String.valueOf(mascotaEditada.getId())}; | |
return baseDeDatos.update(NOMBRE_TABLA, valoresParaActualizar, campoParaActualizar, argumentosParaActualizar); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment