From e794e9f9b7599c1ad6b8760e601c81b19ecc80c6 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 24 Aug 2010 12:32:10 -0700 Subject: [PATCH] Verify that onPause() calls its superclass. Change-Id: Ibf48992b4445bfc726ade307aad26f3e9577c5fb --- core/java/android/app/Activity.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index f7ccc12bd5d1e..ed5af91ca7d00 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -3898,7 +3898,14 @@ public class Activity extends ContextThemeWrapper } final void performPause() { + mCalled = false; onPause(); + if (!mCalled && getApplicationInfo().targetSdkVersion + >= android.os.Build.VERSION_CODES.GINGERBREAD) { + throw new SuperNotCalledException( + "Activity " + mComponent.toShortString() + + " did not call through to super.onPause()"); + } } final void performUserLeaving() {