Inser/ng, upda/ng and dele/ng data
The insert, update and delete operations look very similar to the query operation. In
each case, a function is called on the content resolver object and the appropriate
parameters passed in.
Inser/ng data
Below is a statement to insert a record:
newUri = contentResolver.insert(
UserDictionary.Words.CONTENT_URI,
newValues
)
newValues
is a
ContentValues
which is populated with key-value pairs containing
the column and value of the data to be inserted into the new row.
newURI
contains
the content URI of the new record in the form
content://user_dictionary/
words/
.
Do'stlaringiz bilan baham: |