OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.base; |
| 6 |
| 7 import android.app.Activity; |
| 8 import android.os.Bundle; |
| 9 |
| 10 // All Chromium main activities should extend this class. |
| 11 // This allows various sub-systems to properly react to activity |
| 12 // state changes. |
| 13 public class ChromiumActivity extends Activity { |
| 14 |
| 15 @Override |
| 16 protected void onCreate(Bundle savedInstance) { |
| 17 super.onCreate(savedInstance); |
| 18 ActivityStatus.onStateChange(this, ActivityStatus.CREATED); |
| 19 } |
| 20 |
| 21 @Override |
| 22 protected void onStart() { |
| 23 super.onStart(); |
| 24 ActivityStatus.onStateChange(this, ActivityStatus.STARTED); |
| 25 } |
| 26 |
| 27 @Override |
| 28 protected void onResume() { |
| 29 super.onResume(); |
| 30 ActivityStatus.onStateChange(this, ActivityStatus.STARTED); |
| 31 } |
| 32 |
| 33 @Override |
| 34 protected void onPause() { |
| 35 ActivityStatus.onStateChange(this, ActivityStatus.STARTED); |
| 36 super.onPause(); |
| 37 } |
| 38 |
| 39 @Override |
| 40 protected void onStop() { |
| 41 ActivityStatus.onStateChange(this, ActivityStatus.STARTED); |
| 42 super.onStop(); |
| 43 } |
| 44 |
| 45 @Override |
| 46 protected void onDestroy() { |
| 47 ActivityStatus.onStateChange(this, ActivityStatus.DESTROYED); |
| 48 super.onDestroy(); |
| 49 } |
| 50 } |
OLD | NEW |