# Context.BindServiceFlags

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# BindServiceFlags

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/content/Context.BindServiceFlags "View this page in Java")  

```
class BindServiceFlags
```

|---|--------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                       ||
| ↳ | [android.content.Context.BindServiceFlags](https://developer.android.com/reference/kotlin/android/content/Context.BindServiceFlags#) |

Specific flags used for bindService() call, which encapsulates a 64 bits long integer. Call[BindServiceFlags.of(long)](https://developer.android.com/reference/kotlin/android/content/Context.BindServiceFlags#of(kotlin.Long))to obtain an object of`BindServiceFlags`.

## Summary

|                                                                                                                                                                                                                              Public methods                                                                                                                                                                                                                               ||
|----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Context.BindServiceFlags](https://developer.android.com/reference/kotlin/android/content/Context.BindServiceFlags#) | [of](https://developer.android.com/reference/kotlin/android/content/Context.BindServiceFlags#of(kotlin.Long))`(`value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Build[BindServiceFlags](https://developer.android.com/reference/kotlin/android/content/Context.BindServiceFlags#)from BIND_\* FLAGS. |

## Public methods

### of

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static fun of(value: Long): Context.BindServiceFlags
```

Build[BindServiceFlags](https://developer.android.com/reference/kotlin/android/content/Context.BindServiceFlags#)from BIND_\* FLAGS. Note,[BIND_EXTERNAL_SERVICE](https://developer.android.com/reference/kotlin/android/content/Context#BIND_EXTERNAL_SERVICE:kotlin.Int)is not supported in this method, because it has the highest integer bit set and cause wrong flags to be set. Use[BIND_EXTERNAL_SERVICE_LONG](https://developer.android.com/reference/kotlin/android/content/Context#BIND_EXTERNAL_SERVICE_LONG:kotlin.Long)instead.

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ||
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `value` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):Value is either`0`or a combination of[android.content.Context#BIND_AUTO_CREATE](https://developer.android.com/reference/kotlin/android/content/Context#BIND_AUTO_CREATE:kotlin.Int),[android.content.Context#BIND_DEBUG_UNBIND](https://developer.android.com/reference/kotlin/android/content/Context#BIND_DEBUG_UNBIND:kotlin.Int),[android.content.Context#BIND_NOT_FOREGROUND](https://developer.android.com/reference/kotlin/android/content/Context#BIND_NOT_FOREGROUND:kotlin.Int),[android.content.Context#BIND_ABOVE_CLIENT](https://developer.android.com/reference/kotlin/android/content/Context#BIND_ABOVE_CLIENT:kotlin.Int),[android.content.Context#BIND_ALLOW_OOM_MANAGEMENT](https://developer.android.com/reference/kotlin/android/content/Context#BIND_ALLOW_OOM_MANAGEMENT:kotlin.Int),[android.content.Context#BIND_WAIVE_PRIORITY](https://developer.android.com/reference/kotlin/android/content/Context#BIND_WAIVE_PRIORITY:kotlin.Int),[android.content.Context#BIND_IMPORTANT](https://developer.android.com/reference/kotlin/android/content/Context#BIND_IMPORTANT:kotlin.Int),[android.content.Context#BIND_ADJUST_WITH_ACTIVITY](https://developer.android.com/reference/kotlin/android/content/Context#BIND_ADJUST_WITH_ACTIVITY:kotlin.Int),[android.content.Context#BIND_NOT_PERCEPTIBLE](https://developer.android.com/reference/kotlin/android/content/Context#BIND_NOT_PERCEPTIBLE:kotlin.Int),[android.content.Context#BIND_ALLOW_ACTIVITY_STARTS](https://developer.android.com/reference/kotlin/android/content/Context#BIND_ALLOW_ACTIVITY_STARTS:kotlin.Int),[android.content.Context#BIND_INCLUDE_CAPABILITIES](https://developer.android.com/reference/kotlin/android/content/Context#BIND_INCLUDE_CAPABILITIES:kotlin.Int),[android.content.Context#BIND_SHARED_ISOLATED_PROCESS](https://developer.android.com/reference/kotlin/android/content/Context#BIND_SHARED_ISOLATED_PROCESS:kotlin.Int),[android.content.Context#BIND_PACKAGE_ISOLATED_PROCESS](https://developer.android.com/reference/kotlin/android/content/Context#BIND_PACKAGE_ISOLATED_PROCESS:kotlin.Int), and[android.content.Context#BIND_EXTERNAL_SERVICE_LONG](https://developer.android.com/reference/kotlin/android/content/Context#BIND_EXTERNAL_SERVICE_LONG:kotlin.Long) |

|                                                                      Return                                                                       ||
|----------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [Context.BindServiceFlags](https://developer.android.com/reference/kotlin/android/content/Context.BindServiceFlags#) | This value cannot be`null`. |