summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]res/layout/quickcontact_activity_landscape.xml9
-rwxr-xr-xsrc/com/android/contacts/group/GroupEditorFragment.java21
2 files changed, 24 insertions, 6 deletions
diff --git a/res/layout/quickcontact_activity_landscape.xml b/res/layout/quickcontact_activity_landscape.xml
index 5f3bbc4a8..079220cf9 100644..100755
--- a/res/layout/quickcontact_activity_landscape.xml
+++ b/res/layout/quickcontact_activity_landscape.xml
@@ -47,6 +47,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00000000"
+ android:layout_weight="1"
android:id="@+id/toolbar_parent">
<include layout="@layout/quickcontact_header" />
@@ -54,9 +55,13 @@
<include layout="@layout/quickcontact_title_and_phoneticname" />
</FrameLayout>
-
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="3"
+ android:orientation="horizontal">
<include layout="@layout/quickcontact_content" />
-
+ </LinearLayout>
</LinearLayout>
</LinearLayout>
diff --git a/src/com/android/contacts/group/GroupEditorFragment.java b/src/com/android/contacts/group/GroupEditorFragment.java
index 0ef3d3ac5..9c568b44e 100755
--- a/src/com/android/contacts/group/GroupEditorFragment.java
+++ b/src/com/android/contacts/group/GroupEditorFragment.java
@@ -104,6 +104,7 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
private static final String CURRENT_EDITOR_TAG = "currentEditorForAccount";
public static final int REQUEST_CODE_PICK_GROUP_MEM = 1001;
+ private static final int MAX_CACHE_MEMBER_SIZE = 500;
public static interface Listener {
/**
@@ -238,7 +239,7 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
onRestoreInstanceState(savedInstanceState);
if (mStatus == Status.SELECTING_ACCOUNT) {
// Account select dialog is showing. Don't setup the editor yet.
- } else if (mStatus == Status.LOADING) {
+ } else if (mStatus == Status.LOADING || getCacheSize() == 0) {
startGroupMetaDataLoader();
} else {
setupEditorForAccount();
@@ -288,9 +289,15 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
outState.putBoolean(KEY_GROUP_NAME_IS_READ_ONLY, mGroupNameIsReadOnly);
outState.putString(KEY_ORIGINAL_GROUP_NAME, mOriginalGroupName);
- outState.putParcelableArrayList(KEY_MEMBERS_TO_ADD, mListMembersToAdd);
- outState.putParcelableArrayList(KEY_MEMBERS_TO_REMOVE, mListMembersToRemove);
- outState.putParcelableArrayList(KEY_MEMBERS_TO_DISPLAY, mListToDisplay);
+ // if size is too large,it will cause TransactionTooLargeException,so add limit here
+ if (getCacheSize() <= MAX_CACHE_MEMBER_SIZE) {
+ outState.putParcelableArrayList(KEY_MEMBERS_TO_ADD,
+ mListMembersToAdd);
+ outState.putParcelableArrayList(KEY_MEMBERS_TO_REMOVE,
+ mListMembersToRemove);
+ outState.putParcelableArrayList(KEY_MEMBERS_TO_DISPLAY,
+ mListToDisplay);
+ }
}
private void onRestoreInstanceState(Bundle state) {
@@ -311,6 +318,12 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
mListToDisplay = state.getParcelableArrayList(KEY_MEMBERS_TO_DISPLAY);
}
+ private int getCacheSize() {
+ int size = mListMembersToAdd.size() + mListMembersToRemove.size()
+ + mListToDisplay.size();
+ return size;
+ }
+
public void setContentResolver(ContentResolver resolver) {
mContentResolver = resolver;
if (mAutoCompleteAdapter != null) {