Code example for Uri

Methods: notifyChangegetPathSegments

0
                        values,
                        selection,
                        selectionArgs);
                break; 
            case VIBRATION_ID:
                String id = uri.getPathSegments().get(1);
                if (Integer.parseInt(id) == 0) {
                    Log.i(TAG, "Not updating default vibration");
                    return count;
                } 
                count = vibrationsDB.update(
                        DATABASE_TABLE,
                        values,
                        _ID + " = " + uri.getPathSegments().get(1) +
                                (!TextUtils.isEmpty(selection) ? " AND (" +
                                        selection + ')' : ""),
                        selectionArgs);
                break; 
            default: 
                throw new IllegalArgumentException(
                        "Unknown URI " + uri);
        } 
        getContext().getContentResolver().notifyChange(uri, null);
        return count;
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java