Upload your study docs or become a
Course Hero member to access this document
Unformatted text preview: •// Called by Persist1 to insert data entered by the user into •// the database. We could use raw SQL (execSQL) but it is better to • // use the purpose built insert method. •public long insertDetails(String name, String dob, String email) { • ContentValues rowValues = new ContentValues();• // Assemble row of data in the ContentValues object •rowValues.put("name", name); • rowValues.put("dob", dob);• rowValues.put("email", email); • // Note that if you use insert() rather than insertOrThrow any • // exception will get swallowed by the method• return database.insertOrThrow("details", null, rowValues); • }...
View
Full Document