1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package androidx.lifecycle.testapp; 18 19 import android.os.Bundle; 20 21 import androidx.fragment.app.FragmentActivity; 22 23 /** 24 * Activity for testing events by themselves 25 */ 26 public class LifecycleTestActivity extends FragmentActivity { 27 28 /** 29 * identifies that 30 */ 31 public boolean mLifecycleCallFinished; 32 33 @Override onCreate(Bundle savedInstanceState)34 protected void onCreate(Bundle savedInstanceState) { 35 mLifecycleCallFinished = false; 36 super.onCreate(savedInstanceState); 37 mLifecycleCallFinished = true; 38 } 39 40 @Override onStart()41 protected void onStart() { 42 mLifecycleCallFinished = false; 43 super.onStart(); 44 mLifecycleCallFinished = true; 45 } 46 47 @Override onResume()48 protected void onResume() { 49 mLifecycleCallFinished = false; 50 super.onResume(); 51 mLifecycleCallFinished = true; 52 } 53 54 @Override onPause()55 protected void onPause() { 56 mLifecycleCallFinished = false; 57 super.onPause(); 58 mLifecycleCallFinished = true; 59 } 60 61 @Override onStop()62 protected void onStop() { 63 mLifecycleCallFinished = false; 64 super.onStop(); 65 mLifecycleCallFinished = true; 66 } 67 68 @Override onDestroy()69 protected void onDestroy() { 70 mLifecycleCallFinished = false; 71 super.onDestroy(); 72 mLifecycleCallFinished = true; 73 } 74 } 75