summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2014-04-02 14:08:31 +0800
committerAdnan <adnan@cyngn.com>2014-08-26 17:06:36 -0700
commit58b97fe09205eea731f5a51d7be0a83230550ab8 (patch)
tree1069e1b643d0c5c2afa9089e29bf80c2667d73f7
parenteca2ff9594a19c169898ee319f1230ed802efbf0 (diff)
downloadandroid_packages_providers_DownloadProvider-58b97fe09205eea731f5a51d7be0a83230550ab8.zip
android_packages_providers_DownloadProvider-58b97fe09205eea731f5a51d7be0a83230550ab8.tar.gz
android_packages_providers_DownloadProvider-58b97fe09205eea731f5a51d7be0a83230550ab8.tar.bz2
DownloadProvider: fix the crash when rotate screen.
TrampolineActivity will be recreated when rotate screen, then the fragment is currently associated with any Activity. So getActivity() will return a null and caused NullPointerException. Add the null check before call finish(). CRs-Fixed: 640914 Change-Id: I76f368a597552e824d533b6a66ea23fad4c0cb41
-rwxr-xr-xui/src/com/android/providers/downloads/ui/TrampolineActivity.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/src/com/android/providers/downloads/ui/TrampolineActivity.java b/ui/src/com/android/providers/downloads/ui/TrampolineActivity.java
index f9983fc..8ada01b 100755
--- a/ui/src/com/android/providers/downloads/ui/TrampolineActivity.java
+++ b/ui/src/com/android/providers/downloads/ui/TrampolineActivity.java
@@ -165,7 +165,9 @@ public class TrampolineActivity extends Activity {
@Override
public void onDismiss(DialogInterface dialog) {
super.onDismiss(dialog);
- getActivity().finish();
+ if (getActivity() != null) {
+ getActivity().finish();
+ }
}
}
@@ -234,7 +236,9 @@ public class TrampolineActivity extends Activity {
@Override
public void onDismiss(DialogInterface dialog) {
super.onDismiss(dialog);
- getActivity().finish();
+ if (getActivity() != null) {
+ getActivity().finish();
+ }
}
}
}