# Notification.CallStyle

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

# CallStyle

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/app/Notification.CallStyle "View this page in Java")  

```
open class CallStyle : Notification.Style
```

|---|---|--------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                              |||
| ↳ | [android.app.Notification.Style](https://developer.android.com/reference/kotlin/android/app/Notification.Style)             ||
|   | ↳ | [android.app.Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#) |

Helper class for generating large-format notifications that include a caller and required actions, such as an incoming call with answer / decline.

Here's how you'd set the`CallStyle`on a notification:  

```kotlin
Notification notif = new Notification.Builder(mContext)
      .setSmallIcon(R.drawable.new_post)
      .setStyle(Notification.CallStyle.forIncomingCall(caller, declineIntent, answerIntent))
      .build();
  
```

Note that this style doesn't display the large icon set via[Builder.setLargeIcon(Icon)](https://developer.android.com/reference/kotlin/android/app/Notification.Builder#setLargeIcon(android.graphics.drawable.Icon)).

## Summary

|                                                                                                                               Constants                                                                                                                                ||
|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CALL_TYPE_INCOMING](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#CALL_TYPE_INCOMING:kotlin.Int) Call type for incoming calls.                  |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CALL_TYPE_ONGOING](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#CALL_TYPE_ONGOING:kotlin.Int) Call type for ongoing calls.                     |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CALL_TYPE_SCREENING](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#CALL_TYPE_SCREENING:kotlin.Int) Call type for calls that are being screened. |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CALL_TYPE_UNKNOWN](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#CALL_TYPE_UNKNOWN:kotlin.Int) Unknown call type.                               |

|                                                                                                                                                                                                                                                                                                                                             Public methods                                                                                                                                                                                                                                                                                                                                              ||
|------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| openstatic[Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#) | [forIncomingCall](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#forIncomingCall(android.app.Person,%20android.app.PendingIntent,%20android.app.PendingIntent))`(`person:` `[Person](https://developer.android.com/reference/kotlin/android/app/Person)`, `declineIntent:` `[PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent)`, `answerIntent:` `[PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent)`)` Create a CallStyle for an incoming call.               |
| openstatic[Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#) | [forOngoingCall](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#forOngoingCall(android.app.Person,%20android.app.PendingIntent))`(`person:` `[Person](https://developer.android.com/reference/kotlin/android/app/Person)`, `hangUpIntent:` `[PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent)`)` Create a CallStyle for an ongoing call.                                                                                                                                                             |
| openstatic[Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#) | [forScreeningCall](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#forScreeningCall(android.app.Person,%20android.app.PendingIntent,%20android.app.PendingIntent))`(`person:` `[Person](https://developer.android.com/reference/kotlin/android/app/Person)`, `hangUpIntent:` `[PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent)`, `answerIntent:` `[PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent)`)` Create a CallStyle for a call that is being screened. |
| open[Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#)       | [setAnswerButtonColorHint](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#setAnswerButtonColorHint(kotlin.Int))`(`color:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Optional color to be used as a hint for the Answer action button's color.                                                                                                                                                                                                                                                           |
| open[Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#)       | [setDeclineButtonColorHint](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#setDeclineButtonColorHint(kotlin.Int))`(`color:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Optional color to be used as a hint for the Decline or Hang Up action button's color.                                                                                                                                                                                                                                             |
| open[Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#)       | [setIsVideo](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#setIsVideo(kotlin.Boolean))`(`isVideo:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets whether the call is a video call, which may affect the icons or text used on the required action buttons.                                                                                                                                                                                                                                    |
| open[Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#)       | [setVerificationIcon](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#setVerificationIcon(android.graphics.drawable.Icon))`(`verificationIcon:` `[Icon](https://developer.android.com/reference/kotlin/android/graphics/drawable/Icon.html#)?`)` Optional icon to be displayed with[text](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#setVerificationText(kotlin.CharSequence))as a verification status of the caller.                                                                                  |
| open[Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#)       | [setVerificationText](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#setVerificationText(kotlin.CharSequence))`(`verificationText:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)?`)` Optional text to be displayed with an[icon](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#setVerificationIcon(android.graphics.drawable.Icon))as a verification status of the caller.                                                                             |

| Inherited functions ||
|---|---|
| From class[Style](https://developer.android.com/reference/kotlin/android/app/Notification.Style) |-------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Notification](https://developer.android.com/reference/kotlin/android/app/Notification)!        | [build](https://developer.android.com/reference/kotlin/android/app/Notification.Style#build())`()` <br /> Calls[android.app.Notification.Builder#build()](https://developer.android.com/reference/kotlin/android/app/Notification.Builder#build())on the Builder this Style is attached to. Note: Calling build() multiple times returns the same Notification instance, so reusing a builder to create multiple Notifications is discouraged. <br /> | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                    | [checkBuilder](https://developer.android.com/reference/kotlin/android/app/Notification.Style#checkBuilder())`()` <br />                                                                                                                                                                                                                                                                                                                               | | [RemoteViews](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.html#)! | [getStandardView](https://developer.android.com/reference/kotlin/android/app/Notification.Style#getStandardView(kotlin.Int))`(`layoutId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />                                                                                                                                                                                                                       | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                    | [internalSetBigContentTitle](https://developer.android.com/reference/kotlin/android/app/Notification.Style#internalSetBigContentTitle(kotlin.CharSequence))`(`title:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` <br /> Overrides ContentTitle in the expanded form of the template. This defaults to the value passed to setContentTitle(). <br />                                           | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                    | [internalSetSummaryText](https://developer.android.com/reference/kotlin/android/app/Notification.Style#internalSetSummaryText(kotlin.CharSequence))`(`cs:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` <br /> Set the first line of text after the detail section in the expanded form of the template. <br />                                                                                 | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                    | [setBuilder](https://developer.android.com/reference/kotlin/android/app/Notification.Style#setBuilder(android.app.Notification.Builder))`(`builder:` `[Notification.Builder](https://developer.android.com/reference/kotlin/android/app/Notification.Builder)!`)` <br />                                                                                                                                                                              | ||

| Inherited properties ||
|---|---|
| From class[Style](https://developer.android.com/reference/kotlin/android/app/Notification.Style) |----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------| | [Notification.Builder](https://developer.android.com/reference/kotlin/android/app/Notification.Builder)! | [mBuilder](https://developer.android.com/reference/kotlin/android/app/Notification.Style#mBuilder:android.app.Notification.Builder) <br /> | ||

## Constants

### CALL_TYPE_INCOMING

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

```
static val CALL_TYPE_INCOMING: Int
```

Call type for incoming calls. See[EXTRA_CALL_TYPE](https://developer.android.com/reference/kotlin/android/app/Notification#EXTRA_CALL_TYPE:kotlin.String).  

    Value: 1

### CALL_TYPE_ONGOING

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

```
static val CALL_TYPE_ONGOING: Int
```

Call type for ongoing calls. See[EXTRA_CALL_TYPE](https://developer.android.com/reference/kotlin/android/app/Notification#EXTRA_CALL_TYPE:kotlin.String).  

    Value: 2

### CALL_TYPE_SCREENING

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

```
static val CALL_TYPE_SCREENING: Int
```

Call type for calls that are being screened. See[EXTRA_CALL_TYPE](https://developer.android.com/reference/kotlin/android/app/Notification#EXTRA_CALL_TYPE:kotlin.String).  

    Value: 3

### CALL_TYPE_UNKNOWN

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

```
static val CALL_TYPE_UNKNOWN: Int
```

Unknown call type. See[EXTRA_CALL_TYPE](https://developer.android.com/reference/kotlin/android/app/Notification#EXTRA_CALL_TYPE:kotlin.String).  

    Value: 0

## Public methods

### forIncomingCall

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

```
open static fun forIncomingCall(
    person: Person, 
    declineIntent: PendingIntent, 
    answerIntent: PendingIntent
): Notification.CallStyle
```

Create a CallStyle for an incoming call. This notification will have a decline and an answer action, will allow a single custom[action](https://developer.android.com/reference/kotlin/android/app/Notification.Builder#addAction(android.app.Notification.Action)), and will have a default[content text](https://developer.android.com/reference/kotlin/android/app/Notification.Builder#setContentText(kotlin.CharSequence))for an incoming call.

|                                                                                                           Parameters                                                                                                            ||
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `person`        | [Person](https://developer.android.com/reference/kotlin/android/app/Person):the person displayed as the caller. The person also needs to have a non-empty name associated with it. This value cannot be`null`. |
| `declineIntent` | [PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent):the intent to be sent when the user taps the decline action This value cannot be`null`.                              |
| `answerIntent`  | [PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent):the intent to be sent when the user taps the answer action This value cannot be`null`.                               |

|                                                                  Return                                                                   ||
|--------------------------------------------------------------------------------------------------------------|-----------------------------|
| [Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#) | This value cannot be`null`. |

### forOngoingCall

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

```
open static fun forOngoingCall(
    person: Person, 
    hangUpIntent: PendingIntent
): Notification.CallStyle
```

Create a CallStyle for an ongoing call. This notification will have a hang up action, will allow up to two custom[actions](https://developer.android.com/reference/kotlin/android/app/Notification.Builder#addAction(android.app.Notification.Action)), and will have a default[content text](https://developer.android.com/reference/kotlin/android/app/Notification.Builder#setContentText(kotlin.CharSequence))for an ongoing call.

|                                                                                                                       Parameters                                                                                                                       ||
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `person`       | [Person](https://developer.android.com/reference/kotlin/android/app/Person):the person displayed as being on the other end of the call. The person also needs to have a non-empty name associated with it. This value cannot be`null`. |
| `hangUpIntent` | [PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent):the intent to be sent when the user taps the hang up action This value cannot be`null`.                                                      |

|                                                                  Return                                                                   ||
|--------------------------------------------------------------------------------------------------------------|-----------------------------|
| [Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#) | This value cannot be`null`. |

### forScreeningCall

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

```
open static fun forScreeningCall(
    person: Person, 
    hangUpIntent: PendingIntent, 
    answerIntent: PendingIntent
): Notification.CallStyle
```

Create a CallStyle for a call that is being screened. This notification will have a hang up and an answer action, will allow a single custom[action](https://developer.android.com/reference/kotlin/android/app/Notification.Builder#addAction(android.app.Notification.Action)), and will have a default[content text](https://developer.android.com/reference/kotlin/android/app/Notification.Builder#setContentText(kotlin.CharSequence))for a call that is being screened.

|                                                                                                           Parameters                                                                                                           ||
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `person`       | [Person](https://developer.android.com/reference/kotlin/android/app/Person):the person displayed as the caller. The person also needs to have a non-empty name associated with it. This value cannot be`null`. |
| `hangUpIntent` | [PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent):the intent to be sent when the user taps the hang up action This value cannot be`null`.                              |
| `answerIntent` | [PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent):the intent to be sent when the user taps the answer action This value cannot be`null`.                               |

|                                                                  Return                                                                   ||
|--------------------------------------------------------------------------------------------------------------|-----------------------------|
| [Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#) | This value cannot be`null`. |

### setAnswerButtonColorHint

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

```
open fun setAnswerButtonColorHint(color: Int): Notification.CallStyle
```

Optional color to be used as a hint for the Answer action button's color. The system may change this color to ensure sufficient contrast with the background. The system may choose to disregard this hint if the notification is not colorized.

|                                                                  Return                                                                   ||
|--------------------------------------------------------------------------------------------------------------|-----------------------------|
| [Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#) | This value cannot be`null`. |

### setDeclineButtonColorHint

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

```
open fun setDeclineButtonColorHint(color: Int): Notification.CallStyle
```

Optional color to be used as a hint for the Decline or Hang Up action button's color. The system may change this color to ensure sufficient contrast with the background. The system may choose to disregard this hint if the notification is not colorized.

|                                                                  Return                                                                   ||
|--------------------------------------------------------------------------------------------------------------|-----------------------------|
| [Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#) | This value cannot be`null`. |

### setIsVideo

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

```
open fun setIsVideo(isVideo: Boolean): Notification.CallStyle
```

Sets whether the call is a video call, which may affect the icons or text used on the required action buttons.

|                                                                  Return                                                                   ||
|--------------------------------------------------------------------------------------------------------------|-----------------------------|
| [Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#) | This value cannot be`null`. |

### setVerificationIcon

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

```
open fun setVerificationIcon(verificationIcon: Icon?): Notification.CallStyle
```

Optional icon to be displayed with[text](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#setVerificationText(kotlin.CharSequence))as a verification status of the caller.

|                                                                Parameters                                                                 ||
|--------------------|-----------------------------------------------------------------------------------------------------------------------|
| `verificationIcon` | [Icon](https://developer.android.com/reference/kotlin/android/graphics/drawable/Icon.html#)?:This value may be`null`. |

|                                                                  Return                                                                   ||
|--------------------------------------------------------------------------------------------------------------|-----------------------------|
| [Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#) | This value cannot be`null`. |

### setVerificationText

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

```
open fun setVerificationText(verificationText: CharSequence?): Notification.CallStyle
```

Optional text to be displayed with an[icon](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#setVerificationIcon(android.graphics.drawable.Icon))as a verification status of the caller.

|                                                                 Parameters                                                                  ||
|--------------------|-------------------------------------------------------------------------------------------------------------------------|
| `verificationText` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)?:This value may be`null`. |

|                                                                  Return                                                                   ||
|--------------------------------------------------------------------------------------------------------------|-----------------------------|
| [Notification.CallStyle](https://developer.android.com/reference/kotlin/android/app/Notification.CallStyle#) | This value cannot be`null`. |