ContentProvider delete - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ContentProvider delete method.

This code example shows how to use the following methods:match
   		onNotityChanges(resolver, notifyUri, match);
    } 
 
    @Override 
    public int delete(Uri uri, String selection, String[] selectionArgs) {
        final int match = getUriMatcher().match(uri);
        Integer result = delete(uri, selection, selectionArgs, match);
        if (result != null)
            return result.intValue();
 
		switch(match) {
			case MY_TABLE_COUNT:
			case MY_TABLE_SUM:
				throw new UnsupportedOperationException("Can't delete using a sum or count uri. (MyTable)");
			case MY_VIEW_COUNT:
			case MY_VIEW_SUM:
				throw new UnsupportedOperationException("Can't delete using a sum or count uri. (MyView)");
			case MY_VIEW:
			case MY_VIEW_ID:
			case MY_VIEW_LOOKUP:
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:delete, insert, query
ContentProvider provider = getProvider();
    	 
    	Uri uri = EventStreamContentProvider.content_uri;
    	 
    	Uri entryUri = provider.insert(uri, null);
 
    	Cursor c = provider.query(uri, null, null, null, null);    	
    	int entries = c.getCount();
    	c.close();
    	 
    	int result = provider.delete(entryUri, null, null);
    	 
    	c = provider.query(uri, null, null, null, null);    	
    	int entriesnow = c.getCount();
    	c.close();
    	 
    	assertEquals(1, result);
    	assertTrue(entriesnow < entries);    
    } 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:delete
	} 
 
	@Override 
	public int delete(Uri uri, String selection, String[] selectionArgs) {
		try { 
			return mProvider.delete(uri, selection, selectionArgs);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} 
		return 0; 
	} 
 
	@Override 
	public String getType(Uri uri) {
		try { 
			return mProvider.getType(uri);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:delete
    //    public final Bundle call(String method, String arg, Bundle extras) throws RemoteException { 
    //        return mUnderlying.call(method, arg, extras); 
    //    } 
 
    public final int delete(Uri url, String selection, String[] selectionArgs) throws RemoteException {
        return mUnderlying.delete(url, selection, selectionArgs);
    } 
 
    public boolean equals(Object o) {
        return mUnderlying.equals(o);
    } 
 
    public final ContentProvider getLocalContentProvider() {
        return mUnderlying.getLocalContentProvider();
    } 
 
    public final String[] getStreamTypes(Uri url, String mimeTypeFilter) throws RemoteException {
        return mUnderlying.getStreamTypes(url, mimeTypeFilter);
    } 
 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:delete
	public Cursor query(ContentResolver provider) {
		return provider.query(table, projection, selection, selectionArgs, sortOrder);
	} 
 
	public int delete(ContentProviderClient provider) throws RemoteException {
		return provider.delete(table, selection, selectionArgs);
	} 
 
	public int update(ContentProviderClient provider, ContentValues values) throws RemoteException {
		return provider.update(table, values, selection, selectionArgs);
	} 
 
	public Cursor query(ContentProviderClient provider) throws RemoteException {
		return provider.query(table, projection, selection, selectionArgs, sortOrder);
	} 
 
	public int delete(ContentProvider provider) {
		return provider.delete(table, selection, selectionArgs);
	} 
 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:delete
                throw new IllegalArgumentException("There is no relation between " + parent
                        + " and " + mToTable + ": ID " + childId);
            } 
 
            if (mToContentUri != null) {
                count = provider.delete(ContentUris.withAppendedId(mToContentUri, childId), where,
                        whereArgs);
            } else { 
                count = db.delete(mToTable,
                        ProviderUtils.addExtraWhere(where, BaseColumns._ID + "=?"),
                        ProviderUtils.addExtraWhereArgs(whereArgs, String.valueOf(childId)));
            } 
 
            db.setTransactionSuccessful();
 
        } finally { 
            db.endTransaction();
        } 
        return count;
    } 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
delete Method Overview
Implement this to handle requests to delete one or more rows.
See Code Examples for other Android ContentProvider Methods: