Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70058d65 authored by blong's avatar blong Committed by Gerrit - the friendly Code Review server
Browse files

Fix group member refresh double problem

- When save complete, it will reload group member combine with
  the added members to display,so it refresh doubles.add judge
  to avoid reload member after save complete.

Change-Id: I36f195318607ec4942d08027cd7b722c2ed17e53
CRs-Fixed: 1065034
parent 375f020a
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -106,6 +106,9 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
    public static final int REQUEST_CODE_PICK_GROUP_MEM = 1001;
    private static final int MAX_CACHE_MEMBER_SIZE = 500;

    //when save completed,close activity directly,no need reload group member.
    private boolean mClose = false;

    public static interface Listener {
        /**
         * Group metadata was not found, close the fragment now.
@@ -676,7 +679,7 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
            }
            return false;
        }

        mClose = true;
        // If we are about to close the editor - there is no need to refresh the data
        getLoaderManager().destroyLoader(LOADER_EXISTING_MEMBERS);

@@ -857,12 +860,15 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog

        @Override
        public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
            if (!mClose) {
                bindGroupMetaData(data);

                // Load existing members
                getLoaderManager().initLoader(LOADER_EXISTING_MEMBERS, null,
                        mGroupMemberListLoaderListener);
            }
            mClose = false;
        }

        @Override
        public void onLoaderReset(Loader<Cursor> loader) {}