aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Mok <kmok@cyngn.com>2016-06-08 10:04:20 -0700
committerKeith Mok <kmok@cyngn.com>2016-07-05 07:45:13 -0700
commite3a71a2b528bd90c58fa44c37d5fae76bd8fe9c7 (patch)
tree6dd6f0cf37e732e7f9eae57fb0b82fab1e202790
parentf451f579bc8fc79fe4b951077e348d703a21bd65 (diff)
downloadandroid_packages_apps_CMFileManager-e3a71a2b528bd90c58fa44c37d5fae76bd8fe9c7.tar.gz
android_packages_apps_CMFileManager-e3a71a2b528bd90c58fa44c37d5fae76bd8fe9c7.tar.bz2
android_packages_apps_CMFileManager-e3a71a2b528bd90c58fa44c37d5fae76bd8fe9c7.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 (cherry picked from commit f86cee7c670f03d9b010539f8105f091a06fa275)
-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 707724a3..ba5fa53a 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();
+ }
}
/**