# UserActivityState

# UserActivityState

Artifact:[androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health)  
[View Source](https://cs.android.com/search?q=file:androidx/health/services/client/data/UserActivityState.kt+class:androidx.health.services.client.data.UserActivityState)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/health/services/client/data/UserActivityState "View this page in Java")

<br />

```
class UserActivityState
```

<br />

*** ** * ** ***

Types of user activity states.

## Summary

|                                              ### Public companion properties                                               |
|----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [UserActivityState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/UserActivityState) | [USER_ACTIVITY_ASLEEP](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/UserActivityState#USER_ACTIVITY_ASLEEP()) The user is asleep.                                                                                                        |
| [UserActivityState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/UserActivityState) | [USER_ACTIVITY_EXERCISE](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/UserActivityState#USER_ACTIVITY_EXERCISE()) The user is currently exercising.                                                                                      |
| [UserActivityState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/UserActivityState) | [USER_ACTIVITY_PASSIVE](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/UserActivityState#USER_ACTIVITY_PASSIVE()) The user is awake but is not currently exercising.                                                                       |
| [UserActivityState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/UserActivityState) | [USER_ACTIVITY_UNKNOWN](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/UserActivityState#USER_ACTIVITY_UNKNOWN()) The current activity state cannot be determined, or it is a new state that this library version is too old to recognize. |

|                                                                                                                                                                ### Public constructors                                                                                                                                                                 |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [UserActivityState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/UserActivityState#UserActivityState(kotlin.Int,kotlin.String))`(id: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, name: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`)` |

|                                        ### Public functions                                         |
|-----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/UserActivityState#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                  | [hashCode](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/UserActivityState#hashCode())`()`                                                                                            |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)            | [toString](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/UserActivityState#toString())`()`                                                                                            |

|                               ### Public properties                               |
|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)       | [id](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/UserActivityState#id())     |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | [name](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/UserActivityState#name()) |

## Public companion properties

### USER_ACTIVITY_ASLEEP

```
val USER_ACTIVITY_ASLEEP: UserActivityState
```

The user is asleep.  

### USER_ACTIVITY_EXERCISE

```
val USER_ACTIVITY_EXERCISE: UserActivityState
```

The user is currently exercising.  

### USER_ACTIVITY_PASSIVE

```
val USER_ACTIVITY_PASSIVE: UserActivityState
```

The user is awake but is not currently exercising.  

### USER_ACTIVITY_UNKNOWN

```
val USER_ACTIVITY_UNKNOWN: UserActivityState
```

The current activity state cannot be determined, or it is a new state that this library version is too old to recognize.  

## Public constructors

### UserActivityState

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)  

```
UserActivityState(id: Int, name: String)
```  

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```  

### hashCode

```
open fun hashCode(): Int
```  

### toString

```
open fun toString(): String
```  

## Public properties

### id

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)  

```
val id: Int
```  

### name

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)  

```
val name: String
```