summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2010-02-17 14:07:31 -0500
committerJoe Onorato <joeo@android.com>2010-02-17 14:08:32 -0500
commit339cdd9816ed7737d3b6669dca66608d867dd82a (patch)
treece0182588e3ae8123e8ce976e31ede25d66c66f4 /src
parentf0dde0927be6bc64112cb8db09a6b17b5e71bf18 (diff)
downloadandroid_packages_apps_Trebuchet-339cdd9816ed7737d3b6669dca66608d867dd82a.tar.gz
android_packages_apps_Trebuchet-339cdd9816ed7737d3b6669dca66608d867dd82a.tar.bz2
android_packages_apps_Trebuchet-339cdd9816ed7737d3b6669dca66608d867dd82a.zip
fix 2411389 - calling RS with no Context
This thing where the context sometimes works and sometimes doesn't is starting to piss me off. We really need to have RenderScriptActivity that deals with the lifecycle for you...
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/AllAppsView.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java
index 321874b81..d3503de27 100644
--- a/src/com/android/launcher2/AllAppsView.java
+++ b/src/com/android/launcher2/AllAppsView.java
@@ -160,9 +160,14 @@ public class AllAppsView extends RSSurfaceView
mRS = createRenderScript(true);
}
+ /**
+ * Note that this implementation prohibits this view from ever being reattached.
+ */
@Override
protected void onDetachedFromWindow() {
destroyRenderScript();
+ mRS.mMessageCallback = null;
+ mRS = null;
}
/**
@@ -217,7 +222,9 @@ public class AllAppsView extends RSSurfaceView
mRollo.dirtyCheck();
mRollo.resize(w, h);
- mRS.mMessageCallback = mMessageProc = new AAMessage();
+ if (mRS != null) {
+ mRS.mMessageCallback = mMessageProc = new AAMessage();
+ }
Resources res = getContext().getResources();
int barHeight = (int)res.getDimension(R.dimen.button_bar_height);
@@ -683,6 +690,11 @@ public class AllAppsView extends RSSurfaceView
}
public void setApps(ArrayList<ApplicationInfo> list) {
+ if (mRS == null) {
+ // We've been removed from the window. Don't bother with all this.
+ return;
+ }
+
mAllAppsList = list;
if (mRollo != null) {
mRollo.setApps(list);
@@ -695,6 +707,10 @@ public class AllAppsView extends RSSurfaceView
// Not done loading yet. We'll find out about it later.
return;
}
+ if (mRS == null) {
+ // We've been removed from the window. Don't bother with all this.
+ return;
+ }
final int N = list.size();
if (mRollo != null) {