Index: base/android/java/src/org/chromium/base/ChromiumActivity.java |
diff --git a/base/android/java/src/org/chromium/base/ChromiumActivity.java b/base/android/java/src/org/chromium/base/ChromiumActivity.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f857e12b3614766c1dd8218da80290d732912c9d |
--- /dev/null |
+++ b/base/android/java/src/org/chromium/base/ChromiumActivity.java |
@@ -0,0 +1,50 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package org.chromium.base; |
+ |
+import android.app.Activity; |
+import android.os.Bundle; |
+ |
+// All Chromium main activities should extend this class. |
+// This allows various sub-systems to properly react to activity |
+// state changes. |
+public class ChromiumActivity extends Activity { |
+ |
+ @Override |
+ protected void onCreate(Bundle savedInstance) { |
+ super.onCreate(savedInstance); |
+ ActivityStatus.onStateChange(this, ActivityStatus.CREATED); |
+ } |
+ |
+ @Override |
+ protected void onStart() { |
+ super.onStart(); |
+ ActivityStatus.onStateChange(this, ActivityStatus.STARTED); |
+ } |
+ |
+ @Override |
+ protected void onResume() { |
+ super.onResume(); |
+ ActivityStatus.onStateChange(this, ActivityStatus.STARTED); |
+ } |
+ |
+ @Override |
+ protected void onPause() { |
+ ActivityStatus.onStateChange(this, ActivityStatus.STARTED); |
+ super.onPause(); |
+ } |
+ |
+ @Override |
+ protected void onStop() { |
+ ActivityStatus.onStateChange(this, ActivityStatus.STARTED); |
+ super.onStop(); |
+ } |
+ |
+ @Override |
+ protected void onDestroy() { |
+ ActivityStatus.onStateChange(this, ActivityStatus.DESTROYED); |
+ super.onDestroy(); |
+ } |
+} |