OSDN Git Service

Don't append list of accounts every time we return to this screen.
authorAmith Yamasani <yamasani@google.com>
Thu, 22 Sep 2011 21:34:17 +0000 (14:34 -0700)
committerAmith Yamasani <yamasani@google.com>
Thu, 22 Sep 2011 21:34:17 +0000 (14:34 -0700)
Bug: 5355920

Remove the contents of the layout before adding the accounts.

Change-Id: Ic9256140f892968b2388f47d982eaada720df892

res/layout/master_clear.xml
src/com/android/settings/MasterClear.java

index e15169e..268daa0 100644 (file)
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:orientation="vertical"
-                    android:visibility="gone" />
+                    android:visibility="gone">
+                <!-- Do not add any children here as they will be removed in the MasterClear.java
+                    code. A list of accounts will be inserted programmatically. -->
+            </LinearLayout>
             <TextView android:id="@+id/erase_external_option_text"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
index 39b17a9..495f3fd 100644 (file)
@@ -175,6 +175,7 @@ public class MasterClear extends Fragment {
     private void loadAccountList() {
         View accountsLabel = mContentView.findViewById(R.id.accounts_label);
         LinearLayout contents = (LinearLayout)mContentView.findViewById(R.id.accounts);
+        contents.removeAllViews();
 
         Context context = getActivity();