Best code examples for Android ContentResolver class (android.content.ContentResolver)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ContentResolver class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android ContentResolver examples from Open Source projects
This code example shows how to use the following methods: query
44:	Bitmap contactPhoto = localUserContactPhotoCache.get(uri); 
-
47:	Cursor cursor = context.getContentResolver().query(uri, CONTENT_URI_PROJECTION, 
-
57:	localUserContactPhotoCache.put(uri, contactPhoto); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: insert, openAssetFileDescriptor, query, update
92:	long rawId = queryForRawContactId(cr, Long.parseLong(id)); 
-
109:	Cursor cursor = cr.query(ContactsContract.Data.CONTENT_URI, null, where, null, null); 
-
141:	cr.update(uri, values, null, null); 
-
146:	cr.update(uri, values, null, null); 
-
152:	cr.insert(uri, values); 
-
162:	AssetFileDescriptor fd = cr.openAssetFileDescriptor(rawContactPhotoUri, "rw"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: update, put
52:	ContentValues values = new ContentValues(); 
53:	values.put(Calls.NEW, 0); 
54:	values.put(Calls.IS_READ, 1); 
-
60:	getContentResolver().update(Calls.CONTENT_URI, values, where.toString(), 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: query
75:	socialFeed = SocialFeed.fromCursor(contentResolver.query(socialFeedUri, null, null, null, null)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: notifyChange, getPathSegments
81:	String tableName = uri.getPathSegments().get(0); 
-
83:	getContext().getContentResolver().notifyChange(uri, null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: delete, insert, query
62:	Cursor cursor = resolver.query(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI, 
-
92:	Uri uri = resolver.insert(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI, values); 
-
97:	resolver.delete(uri, null, null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: insert
113:	return resolver.insert(uri, values); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: query
104:	feedCursor = contentResolver.query(feedUri, null, null, null, null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: query, openContactPhotoInputStream
53:	Cursor cursor = contentResolver.query(contactUri, 
-
66:	cursor = contentResolver.query(Phone.CONTENT_URI, 
-
80:	cursor = contentResolver.query(Phone.CONTENT_URI, 
-
102:	InputStream input = ContactsContract.Contacts.openContactPhotoInputStream(cr, uri); 
-
117:	Cursor c = cr.query(photoUri, new String[] {ContactsContract.CommonDataKinds.Photo.PHOTO}, null, null, null); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: query
63:	Cursor cursor = contentResolver.query(contactUri, 
-
75:	cursor = contentResolver.query(Phone.CONTENT_URI, 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: notifyChange, getPathSegments
153:	id = uri.getPathSegments().get(1); 
-
162:	getContext().getContentResolver().notifyChange(uri, null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: query
129:	Cursor calendar = cr.query(uri, new String[] { CALENDAR_ID_COLUMN }, null, null, null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: notifyChange, getPathSegments
114:	String rowId = uri.getPathSegments().get(1); 
-
127:	getContext().getContentResolver().notifyChange(uri, null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: query
57:	Cursor cursor = contentResolver.query(contactUri, 
-
68:	cursor = contentResolver.query(phoneUri, 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: query, toString
23:	final Cursor cursor = context.getContentResolver().query(uri, 
-
28:	uri.toString())); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: insert, put
56:	ContentValues values = new ContentValues(); 
57:	values.put(MediaStore.Images.Media.TITLE, filename); 
58:	values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg"); 
59:	mPictureUri = getContentResolver().insert( 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: notifyChange, getPathSegments
123:	assert(uri.getPathSegments().size() == 1); 
-
127:	final int index = Integer.parseInt(uri.getPathSegments().get(0)); 
-
136:	getContext().getContentResolver().notifyChange(uri, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: openInputStream, openOutputStream
64:	InputStream in = mResolver.openInputStream(mUri); 
-
68:	OutputStream out = mResolver.openOutputStream(mUri, "rwt"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: query, update
46:	resolv.update(AwfulPost.CONTENT_URI, 
-
53:	resolv.update(AwfulPost.CONTENT_URI, 
-
59:	Cursor threadData = resolv.query(ContentUris.withAppendedId(AwfulThread.CONTENT_URI, threadId), AwfulProvider.ThreadProjection, null, null, null); 
-
63:	resolv.update(AwfulThread.CONTENT_URI, 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: delete
336:	cr.delete(uri, People._ID + "=" + id, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: query
41:	Cursor cursor = contentResolver.query(contactUri, 
-
55:	cursor = contentResolver.query(Phone.CONTENT_URI, 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getPathLeafId, notifyDelete
196:	int rowCount = mDb.delete(DATABASE_TABLE_NAME, ID + " = " + uri.getPathLeafId()); 
-
199:	getContext().getContentResolver().notifyDelete(uri, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: notifyChange, getPathSegments
65:	String segment = uri.getPathSegments().get(1); 
-
80:	getContext().getContentResolver().notifyChange(uri, null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: delete
162:	return query.runQuery(resolver); 
-
224:	resolver.delete(ContentUris.withAppendedId(uri, getItemId(position)), null, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: insert, query, update
162:	Uri uri = mResolver.insert(REGISTRY_URI, value); 
-
168:	assertEquals(1, mResolver.update(uri, value, null, null)); 
-
170:	Cursor cur = mResolver.query(uri, new String[] { 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: query, toString
115:	if (imageUri.toString().startsWith("content://com.android.gallery3d.provider")) { 
116:	imageUri = Uri.parse(imageUri.toString().replace("com.android.gallery3d", 
-
121:	cursor = activity.getContentResolver().query(imageUri, proj, null, null, null); 
-
123:	cursor = fragment.getActivity().getContentResolver() 
-
126:	cursor = appFragment.getActivity().getContentResolver() 
-
132:	if (imageUri.toString().startsWith("content://com.google.android.gallery3d")) { 
133:	filePath = imageUri.toString(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: insert, put
83:	ContentValues values = new ContentValues(); 
84:	values.put(MediaStore.Images.Media.TITLE, filename); 
85:	values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg"); 
86:	mPictureUri = getContentResolver().insert( 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: query, getPath
384:	Cursor cursor = context.getContentResolver().query(contentURI, null, null, null, null); 
-
386:	return contentURI.getPath(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: notifyChange, getPathSegments
112:	String segment = uri.getPathSegments().get(1); 
-
120:	getContext().getContentResolver().notifyChange(uri, null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: query
15:	final Cursor cursor = resolver.query(uri, new String[]{"_data"}, null, null, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: insert, put
175:	ContentValues values = new ContentValues(); 
176:	values.put(UpdateInfo.UPDATE_URL, updateUrl); 
177:	values.put(UpdateInfo.PACKAGE_NAME, packageName); 
178:	values.put(UpdateInfo.LAST_CHECK, 0); 
179:	context.getContentResolver().insert(UpdateInfo.CONTENT_URI, values); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: insert, put
48:	ContentValues values = new ContentValues(); 
49:	values.put(ContactsContract.RawContacts.ACCOUNT_TYPE, account.type); 
50:	values.put(ContactsContract.RawContacts.ACCOUNT_NAME, account.name); 
51:	values.put(ContactsContract.Settings.UNGROUPED_VISIBLE, true); 
-
53:	m_context.getContentResolver().insert(ContactsContract.Settings.CONTENT_URI, values); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: notifyChange, getPathSegments
261:	String hostId = uri.getPathSegments().get(1); 
-
269:	getContext().getContentResolver().notifyChange(uri, null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: notifyChange, getLastPathSegment
157:	String extraWhere = COLUMN_ID + " = " + uri.getLastPathSegment(); 
-
170:	getContext().getContentResolver().notifyChange(uri, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getType, openAssetFileDescriptor
244:	String mimeType = contentResolver.getType(uri); 
245:	AssetFileDescriptor assetFd = contentResolver.openAssetFileDescriptor(uri, "r"); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: insert, put
177:	ContentValues values = new ContentValues(); 
178:	values.put(MediaStore.Images.Media.DATA, file.getAbsolutePath()); 
179:	values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg"); // setar isso 
180:	values.put(MediaStore.Images.Media.DESCRIPTION, MEDIA_TAG); 
181:	contect.getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: notifyChange, getPathSegments
57:	String segment = url.getPathSegments().get(1); 
-
71:	getContext().getContentResolver().notifyChange(url, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: delete, query
116:	Cursor results = resolver.query(contentUri, 
-
120:	resolver.delete(contentUri, "_display_name=?", new String[] { r 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: notifyChange, getPathSegments
205:	String wordId = uri.getPathSegments().get(1); 
-
214:	getContext().getContentResolver().notifyChange(uri, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: notifyChange, getPathSegments
187:	String segment = uri.getPathSegments().get(1); 
-
201:	getContext().getContentResolver().notifyChange(uri, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: notifyChange, getPathSegments
238:	String videoId = uri.getPathSegments().get(1); 
-
250:	getContext().getContentResolver().notifyChange(uri, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: notifyChange, getPathSegments
146:	String segment = url.getPathSegments().get(1); 
-
162:	getContext().getContentResolver().notifyChange(url, null); 
Full Snippet Info
6
CodeRank
Related Android ContentResolver Questions & Answers:
Other Android ContentResolver Examples
68:	    values.put(MediaStore.Audio.Media.MIME_TYPE, "audio/3gpp");
69:	    values.put(MediaStore.Audio.Media.DATA, audiofile.getAbsolutePath());
70:	    ContentResolver contentResolver = getContentResolver();
71:	
72:	    Uri base = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;

Read More

See Code Examples for Android ContentResolver Methods: