app/src/main/java/com/mensa/zhmensa/activities/MainActivity.java
/**
         * Iterates over all cached fragments and makes sure that the mensaId and the position match
         * Needs to be called after start up, since adding new mensas change the position in sidebar
         * and therefore the fragment needs to be refreshed
         */
Iterates over all cached fragments and makes sure that the mensaId and the position match
Needs to be called after start up, since adding new mensas change the position in sidebar
and therefore the fragment needs to be refreshed
Iterates over all cached fragments and makes sure that the mensaId and the position match Needs to be called after start up since adding new mensas change the position in sidebar and therefore the fragment needs to be refreshed
void syncMenuIds() {
            for (Integer key : positionToFragment.keySet()) {
                MensaOverviewFragment frag = positionToFragment.get(key);
                if (frag == null)
                    continue;
                String id = frag.getMensaId();
                String shouldBeId = getMensaIdForPosition(key);
                if (id != null && !id.equals(shouldBeId)) {
                    Log.d("MainACtivity.chmids", "Found wrong ids: " + id + " : " + shouldBeId);
                    frag.setMensaId(shouldBeId);
                   frag.notifyDatasetChanged();
                }
            }
        }
void syncMenuIds ( ) { for ( Integer key : positionToFragment . keySet ( ) ) { MensaOverviewFragment frag = positionToFragment . get ( key ) ; if ( frag == null ) continue ; String id = frag . getMensaId ( ) ; String shouldBeId = getMensaIdForPosition ( key ) ; if ( id != null && ! id . equals ( shouldBeId ) ) { Log . d ( "MainACtivity.chmids" , "Found wrong ids: " + id + " : " + shouldBeId ) ; frag . setMensaId ( shouldBeId ) ; frag . notifyDatasetChanged ( ) ; } } }
Iterates over all cached fragments and makes sure that the mensaId and the position match
 Needs to be called after start up, since adding new mensas change the position in sidebar
 and therefore the fragment needs to be refreshed
Iterates over all cached fragments and makes sure that the mensaId and the position match Needs to be called after start up since adding new mensas change the position in sidebar and therefore the fragment needs to be refreshed