Merge "Fixed the issue Label name disappear when user change orientation" am: 5174049e63 am: f75e6dcc55 am: c7f7bc131b
am: 834a9d87a1
Change-Id: Iaf188e009b1b67f7d42c287b408a9c54290bab08
diff --git a/src/com/android/contacts/drawer/DrawerFragment.java b/src/com/android/contacts/drawer/DrawerFragment.java
index 0aaa262..854f0e6 100644
--- a/src/com/android/contacts/drawer/DrawerFragment.java
+++ b/src/com/android/contacts/drawer/DrawerFragment.java
@@ -123,6 +123,12 @@
return;
}
mGroupListItems.clear();
+ // Initialize cursor's position. If Activity relaunched by orientation change,
+ // only onLoadFinished is called. OnCreateLoader is not called.
+ // The cursor's position is remain end position by moveToNext when the last
+ // onLoadFinished was called.
+ // Therefore, if cursor position was not initialized mGroupListItems is empty.
+ data.moveToPosition(-1);
for (int i = 0; i < data.getCount(); i++) {
if (data.moveToNext()) {
mGroupListItems.add(GroupUtil.getGroupListItem(data, i));