Ocb

ft Diary DbAdapter ft»»««J W K ^.tfäc . open(), tnÄftftllpiESfftfa:. W££i£:fcft«J¥.

• close(), WffilfcÄ'ifc, Database Helper ^r ^W^^Jg^fKl WM •

• createDiary (String title, String body) ifflil title ill body -j^SüfcftlftJ? -I rt1 fi'J — &

• deleteDiary (longrowld) ifiitid^W id, WMftiJ^t' iti^t.

• getAHNotesOi^flJ diary M'^WlWid.^, ^ Cursor föJfM:üt 1?i£M.

• updateDiary (long rowld, String title. String body ) Ii® id % rowld JW&iüiSlty fföW^?-g title in body ^aiWrtif.

ft^Ä Content"Values % ? JP'hfcHR | Content'Values Hashtable tbftHH«, Ä ft*)", fejtt

«ff]l«l« - K, h-^j FVK ifefflftittil SQL »<WMr*A*f1-:. sql »{gftjtfttft imftM. flifeififh«. mfi^a^« r-^'i'ftfijii'iiw-w^tt, i'J 'i* Content Values 'Vt1* iSJiiftfrSiAifeft. AfMWfcl K/fr^:

public lonq createDiary(String title, String body) I

ContentValues in itialvalues = new Content.Values () ; initialValues.put(KEY TITLE, title); initiialValues.put {KEY BODY, body) ; Calendar calendar = Calendar.getInstance();

String created calendar.get(Calendar.YEAR)+ "^"+calendar.get(Calendar. MONTH)»" H "-»-calendar, get (Calendar. DAY_OF_MONTH) ♦" B "-»calendar. get (Calendar .HOUR OF _DAY)+" " ^ calendar . get (Calendar . MINUTE) < "#";

initialValues.put(KEYCREATED, created);

return mDb.insert(DATABASE TABLE, null, initialValues);

Was this article helpful?

0 0

Post a comment