To insert data into a content provider, you need to use______ 1) insert() 2) bulkInsert() 3) getContentProvider() 4)update()

Options
- 1 and 2
- 3 and 4
- all of the above
- none of these


CORRECT ANSWER : 1 and 2

Discussion Board
Explanation-

To insert data into a content provider there are two options available on the ContentProvider interface (available through getContentProvider():

1. Use insert() with a collection Uri and a ContentValues structure
describing the initial set of data to put in the row
2. Use bulkInsert() with a collection Uri and an array of ContentValues structures to populate several rows at once
The insert() method returns a Uri for you to use for future operations on that new object. The bulkInsert() method returns the number of created rows.


Sapna Ambadkar 03-15-2017 06:33 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement