src/main/java/de/blau/android/osm/StorageDelegator.java
/**
     * Remove members from a relation
     * 
     * Note the potentially present elements do not need to have their state changed or be stored in the API storage
     * since the parent relation back link is just internal.
     * 
     * @param members members to remove
     * @param r relation to remove the element from
     */
Remove members from a relation

Note the potentially present elements do not need to have their state changed or be stored in the API storage
since the parent relation back link is just internal.

@param members members to remove
@param r relation to remove the element from
Remove members from a relation Note the potentially present elements do not need to have their state changed or be stored in the API storage since the parent relation back link is just internal . @param members members to remove @param r relation to remove the element from
public void removeRelationMembersFromRelation(@NonNull Relation r, @NonNull List<RelationMember> members) {
        dirty = true;
        undo.save(r);
        try {
            for (RelationMember member : members) {
                Log.i(DEBUG_TAG, "removing " + member.getType() + " #" + member.getRef() + " from relation #" + r.getOsmId());
                r.removeMember(member);
                if (member.downloaded()) {
                    OsmElement element = member.getElement();
                    undo.save(element);
                    element.removeParentRelation(r);
                    onParentRelationChanged(element);
                }
            }
            r.updateState(OsmElement.STATE_MODIFIED);
            apiStorage.insertElementSafe(r);
            onElementChanged(null, r);
            Log.i(DEBUG_TAG, "... done");
        } catch (StorageException e) {
            Log.e(DEBUG_TAG, "removeMemberFromRelation got " + e.getMessage());
        }
    }
public void removeRelationMembersFromRelation ( @ NonNull Relation r , @ NonNull List < RelationMember > members ) { dirty = true ; undo . save ( r ) ; try { for ( RelationMember member : members ) { Log . i ( DEBUG_TAG , "removing " + member . getType ( ) + " #" + member . getRef ( ) + " from relation #" + r . getOsmId ( ) ) ; r . removeMember ( member ) ; if ( member . downloaded ( ) ) { OsmElement element = member . getElement ( ) ; undo . save ( element ) ; element . removeParentRelation ( r ) ; onParentRelationChanged ( element ) ; } } r . updateState ( OsmElement . STATE_MODIFIED ) ; apiStorage . insertElementSafe ( r ) ; onElementChanged ( null , r ) ; Log . i ( DEBUG_TAG , "... done" ) ; } catch ( StorageException e ) { Log . e ( DEBUG_TAG , "removeMemberFromRelation got " + e . getMessage ( ) ) ; } }
Remove members from a relation
Remove members from a relation
// TODO handle OOM