aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Mok <kmok@cyngn.com>2016-06-08 10:04:20 -0700
committerKeith Mok <kmok@cyngn.com>2016-06-08 10:10:22 -0700
commitf86cee7c670f03d9b010539f8105f091a06fa275 (patch)
treecf338db21097fe0677bb359107d2d24fd270d585
parentb6666263f0988d32536b6a4f69868514966a5a2e (diff)
downloadandroid_packages_apps_CMFileManager-f86cee7c670f03d9b010539f8105f091a06fa275.tar.gz
android_packages_apps_CMFileManager-f86cee7c670f03d9b010539f8105f091a06fa275.tar.bz2
android_packages_apps_CMFileManager-f86cee7c670f03d9b010539f8105f091a06fa275.zip
Check if view is inited when screen rotated
In M, we need to request permission the first time application is use it. And we put that before the creation of the content view. If screen rotated before user confirm the permission dialog box, it will cause onConfigurationChanged to be called, and refreshs the view which is not created yet. Add a null pointer checking to avoid that. FEIJ-1083 Change-Id: Ic3c762e62edef28d4c5d7a7a89fabec3f4324eca
-rw-r--r--src/com/cyanogenmod/filemanager/activities/PickerActivity.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/cyanogenmod/filemanager/activities/PickerActivity.java b/src/com/cyanogenmod/filemanager/activities/PickerActivity.java
index 46194b01..aae6e97e 100644
--- a/src/com/cyanogenmod/filemanager/activities/PickerActivity.java
+++ b/src/com/cyanogenmod/filemanager/activities/PickerActivity.java
@@ -221,7 +221,9 @@ public class PickerActivity extends Activity
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
- measureHeight();
+ if (this.mRootView != null) { // the view may not be ready if we are requesting permission
+ measureHeight();
+ }
}
/**