summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormartincz <martincz@mokeedev.com>2015-09-29 16:39:51 (GMT)
committermartincz <martincz.gao2012@gmail.com>2015-09-29 16:54:45 (GMT)
commit5c3653f3e9f5589ac964ca2758d7ec7d29b2b61e (patch)
tree664949ce37a07a9d6436850fd1078a4eb247e9c7
parente4a62ee23304930700f6935904295350d0883016 (diff)
downloadandroid_packages_apps_Trebuchet-5c3653f3e9f5589ac964ca2758d7ec7d29b2b61e.zip
android_packages_apps_Trebuchet-5c3653f3e9f5589ac964ca2758d7ec7d29b2b61e.tar.gz
android_packages_apps_Trebuchet-5c3653f3e9f5589ac964ca2758d7ec7d29b2b61e.tar.bz2
Trebuchet: fix NPE when QuickSearchBox is missing
Change-Id: I8eb1e02907d1e7f56d43dbff3b2fed1e0846d990
-rw-r--r--src/com/android/launcher3/DeviceProfile.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 2832ec7..d65b475 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -811,11 +811,13 @@ public class DeviceProfile {
// Layout the search bar
View qsbBar = launcher.getQsbBar();
- qsbBar.setVisibility(searchBarVisible ? View.VISIBLE : View.GONE);
- LayoutParams vglp = qsbBar.getLayoutParams();
- vglp.width = LayoutParams.MATCH_PARENT;
- vglp.height = LayoutParams.MATCH_PARENT;
- qsbBar.setLayoutParams(vglp);
+ if (qsbBar != null) {
+ qsbBar.setVisibility(searchBarVisible ? View.VISIBLE : View.GONE);
+ LayoutParams vglp = qsbBar.getLayoutParams();
+ vglp.width = LayoutParams.MATCH_PARENT;
+ vglp.height = LayoutParams.MATCH_PARENT;
+ qsbBar.setLayoutParams(vglp);
+ }
// Layout the workspace
PagedView workspace = (PagedView) launcher.findViewById(R.id.workspace);