summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/ProgressCategory.java
diff options
context:
space:
mode:
authorthigobr <thigobr@gmail.com>2010-07-21 13:10:04 -0300
committerthigobr <thigobr@gmail.com>2010-08-17 12:59:41 -0300
commitd4cebee1e4b68e8b6c1e2ad8b82da6e2414f2e5b (patch)
treeddace5c4b38fe95bb25645253d12425e7a1e198d /src/com/android/settings/ProgressCategory.java
parent46c0a5b12973fcd40b72b48fe344e45f1110865e (diff)
downloadpackages_apps_Settings-d4cebee1e4b68e8b6c1e2ad8b82da6e2414f2e5b.zip
packages_apps_Settings-d4cebee1e4b68e8b6c1e2ad8b82da6e2414f2e5b.tar.gz
packages_apps_Settings-d4cebee1e4b68e8b6c1e2ad8b82da6e2414f2e5b.tar.bz2
Fix Bluetooth Settings activity memory leak.
There were two leaks in Bluetooth Settings: one when rotating the phone and other when scanning for bluetooth devices.
Diffstat (limited to 'src/com/android/settings/ProgressCategory.java')
-rw-r--r--src/com/android/settings/ProgressCategory.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/settings/ProgressCategory.java b/src/com/android/settings/ProgressCategory.java
index 15810b3..f611137 100644
--- a/src/com/android/settings/ProgressCategory.java
+++ b/src/com/android/settings/ProgressCategory.java
@@ -26,7 +26,8 @@ import java.util.Map;
public class ProgressCategory extends PreferenceCategory {
private boolean mProgress = false;
-
+ private View oldView = null;
+
public ProgressCategory(Context context, AttributeSet attrs) {
super(context, attrs);
setLayoutResource(R.layout.preference_progress_category);
@@ -41,6 +42,13 @@ public class ProgressCategory extends PreferenceCategory {
int visibility = mProgress ? View.VISIBLE : View.INVISIBLE;
textView.setVisibility(visibility);
progressBar.setVisibility(visibility);
+
+ if (oldView != null) {
+ oldView.findViewById(R.id.scanning_progress).setVisibility(View.GONE);
+ oldView.findViewById(R.id.scanning_text).setVisibility(View.GONE);
+ oldView.setVisibility(View.GONE);
+ }
+ oldView = view;
}
/**