From 0b26e4d58ab1a60340dd7ab35ca6e3bddff9f760 Mon Sep 17 00:00:00 2001 From: George Mount Date: Wed, 17 Sep 2014 16:36:42 -0700 Subject: Fix exception when fragment container has no View. Bug 17535259 Change-Id: I29c9ef53dd693cbb4043ebfb4750753870c9e99a --- core/java/android/app/Activity.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/java/android/app/Activity.java') diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 701ab1d..9e53a35 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -745,6 +745,11 @@ public class Activity extends ContextThemeWrapper public View findViewById(int id) { return Activity.this.findViewById(id); } + @Override + public boolean hasView() { + Window window = Activity.this.getWindow(); + return (window != null && window.peekDecorView() != null); + } }; // Most recent call to requestVisibleBehind(). -- cgit v1.1