private void updateActivities() {
        if (user != null) {
            activities = new HashMap<>();
            activityIdNameMap = new HashMap<>();

            //get their activities
            ArrayList<Integer> temp = user.getActivities();

            if (temp != null) {
                activityNames = new String[temp.size()];
                Activity a;

                for (int i = 0; i < activityNames.length; ++i) {
                    //get the activity
                    a = (Activity) MongoHelper.fetch(new Activity(temp.get(i)),
                            MongoHelper.ACTIVITY_COLLECTION);

                    //record the name
                    activityNames[i] = a.getName();
                    //store it in the map
                    activities.put(a.getName(), a);
                    activityIdNameMap.put(a.getId(), a.getName());
                }

                //sort
                if (activityNames.length > 1) {
                    Arrays.sort(activityNames);
                }
            }
        }
    }