Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created February 4, 2019 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/cb5a16c5ce8cc26e48dcb11f75350578 to your computer and use it in GitHub Desktop.
Save parzibyte/cb5a16c5ce8cc26e48dcb11f75350578 to your computer and use it in GitHub Desktop.
public long nuevaMascota(Mascota mascota) {
// writable porque vamos a insertar
SQLiteDatabase baseDeDatos = ayudanteBaseDeDatos.getWritableDatabase();
ContentValues valoresParaInsertar = new ContentValues();
valoresParaInsertar.put("nombre", mascota.getNombre());
valoresParaInsertar.put("edad", mascota.getEdad());
return baseDeDatos.insert(NOMBRE_TABLA, null, valoresParaInsertar);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment