Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- }
- public void guardar(){
- String Nombre = text.getText().toString();
- SQLite base = new SQLite( this,"SQLite",null,1 );
- SQLiteDatabase bd = base.getWritableDatabase();
- ContentValues contenedor = new ContentValues();
- contenedor.put("NOMBRE", Nombre );
- contenedor.put( "FECHA",getDate() );
- try {
- bd.insertOrThrow("TRABAJADOR",null,contenedor);
- Toast.makeText( getApplicationContext(),"Ingresado Correctamente",Toast.LENGTH_SHORT ).show();
- }catch (SQLException e){
- Toast.makeText( getApplicationContext(),"No Ingresado",Toast.LENGTH_SHORT ).show();
- }
- bd.close();
- }
Add Comment
Please, Sign In to add comment