# Stage

# Stage

Artifact:[androidx.test:monitor](https://developer.android.com/jetpack/androidx/releases/test)  
[View Source](https://cs.android.com/search?q=file:androidx/test/runner/lifecycle/Stage.java+class:androidx.test.runner.lifecycle.Stage)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/test/runner/lifecycle/Stage "View this page in Java")

<br />

```
enum Stage
```

<br />

*** ** * ** ***

An enumeration of the lifecycle stages an activity undergoes.

See the[android.app.Activity](https://developer.android.com/reference/android/app/Activity.html)javadoc for detailed documentation.

## Summary

|                                                  ### Enum Values                                                   |
|--------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| [CREATED](https://developer.android.com/reference/kotlin/androidx/test/runner/lifecycle/Stage#CREATED)             | Indicates that onCreate has been called.                                           |
| [DESTROYED](https://developer.android.com/reference/kotlin/androidx/test/runner/lifecycle/Stage#DESTROYED)         | Indicates that onDestroy has been called - system is shutting down the activity.   |
| [PAUSED](https://developer.android.com/reference/kotlin/androidx/test/runner/lifecycle/Stage#PAUSED)               | Indicates that onPause has been called - activity is no longer in the foreground.  |
| [PRE_ON_CREATE](https://developer.android.com/reference/kotlin/androidx/test/runner/lifecycle/Stage#PRE_ON_CREATE) | Indicates that onCreate is being called before any onCreate code executes.         |
| [RESTARTED](https://developer.android.com/reference/kotlin/androidx/test/runner/lifecycle/Stage#RESTARTED)         | Indicates that onResume has been called - we have navigated back to the activity.  |
| [RESUMED](https://developer.android.com/reference/kotlin/androidx/test/runner/lifecycle/Stage#RESUMED)             | Indicates that onResume has been called - activity is now visible to user.         |
| [STARTED](https://developer.android.com/reference/kotlin/androidx/test/runner/lifecycle/Stage#STARTED)             | Indicates that onStart has been called.                                            |
| [STOPPED](https://developer.android.com/reference/kotlin/androidx/test/runner/lifecycle/Stage#STOPPED)             | Indicates that onStop has been called - activity is no longer visible to the user. |

|                                                                                       ### Public functions                                                                                        |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[Stage](https://developer.android.com/reference/kotlin/androidx/test/runner/lifecycle/Stage)`!`                                                                                     | [valueOf](https://developer.android.com/reference/kotlin/androidx/test/runner/lifecycle/Stage#valueOf(java.lang.String))`(name: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!)` Returns the enum constant of this type with the specified name. |
| `java-static `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Stage](https://developer.android.com/reference/kotlin/androidx/test/runner/lifecycle/Stage)`!>!` | [values](https://developer.android.com/reference/kotlin/androidx/test/runner/lifecycle/Stage#values())`()` Returns an array containing the constants of this enum type, in the order they're declared.                                                                                 |

## Enum Values

### CREATED

```
val Stage.CREATED: Stage
```

Indicates that onCreate has been called.  

### DESTROYED

```
val Stage.DESTROYED: Stage
```

Indicates that onDestroy has been called - system is shutting down the activity.  

### PAUSED

```
val Stage.PAUSED: Stage
```

Indicates that onPause has been called - activity is no longer in the foreground.  

### PRE_ON_CREATE

```
val Stage.PRE_ON_CREATE: Stage
```

Indicates that onCreate is being called before any onCreate code executes.  

### RESTARTED

```
val Stage.RESTARTED: Stage
```

Indicates that onResume has been called - we have navigated back to the activity.  

### RESUMED

```
val Stage.RESUMED: Stage
```

Indicates that onResume has been called - activity is now visible to user.  

### STARTED

```
val Stage.STARTED: Stage
```

Indicates that onStart has been called.  

### STOPPED

```
val Stage.STOPPED: Stage
```

Indicates that onStop has been called - activity is no longer visible to the user.  

## Public functions

### valueOf

```
java-static fun valueOf(name: String!): Stage!
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)  

|                                             Returns                                             |
|-------------------------------------------------------------------------------------------------|-------------------------------------------|
| [Stage](https://developer.android.com/reference/kotlin/androidx/test/runner/lifecycle/Stage)`!` | the enum constant with the specified name |

|                                                        Throws                                                         |
|-----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------|
| [java.lang.IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException.html) | if this enum type has no constant with the specified name |

### values

```
java-static fun values(): Array<Stage!>!
```

Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.  

|                                                                                       Returns                                                                                       |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Stage](https://developer.android.com/reference/kotlin/androidx/test/runner/lifecycle/Stage)`!>!` | an array containing the constants of this enum type, in the order they're declared |