Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/app/Notification.CallStyle#constants) \| [Inherited Fields](https://developer.android.com/reference/android/app/Notification.CallStyle#inhfields) \| [Methods](https://developer.android.com/reference/android/app/Notification.CallStyle#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/Notification.CallStyle#inhmethods)

# Notification.CallStyle

*** ** * ** ***

` public static class Notification.CallStyle `   
` ` ` extends https://developer.android.com/reference/android/app/Notification.Style ` ` `

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.app.Notification.Style](https://developer.android.com/reference/android/app/Notification.Style) ||
|   | ↳ | android.app.Notification.CallStyle |

<br />

*** ** * ** ***

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:

```
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 `https://developer.android.com/reference/android/app/Notification.Builder#setLargeIcon(android.graphics.drawable.Icon)`.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/app/Notification.CallStyle#CALL_TYPE_INCOMING` Call type for incoming calls. |
| `int` | `https://developer.android.com/reference/android/app/Notification.CallStyle#CALL_TYPE_ONGOING` Call type for ongoing calls. |
| `int` | `https://developer.android.com/reference/android/app/Notification.CallStyle#CALL_TYPE_SCREENING` Call type for calls that are being screened. |
| `int` | `https://developer.android.com/reference/android/app/Notification.CallStyle#CALL_TYPE_UNKNOWN` Unknown call type. |

### Inherited fields

From class `https://developer.android.com/reference/android/app/Notification.Style` ` protected https://developer.android.com/reference/android/app/Notification.Builder` `https://developer.android.com/reference/android/app/Notification.Style#mBuilder`

<br />

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

### Inherited methods

From class ` https://developer.android.com/reference/android/app/Notification.Style ` ` https://developer.android.com/reference/android/app/Notification` ` https://developer.android.com/reference/android/app/Notification.Style#build()() `

Calls `https://developer.android.com/reference/android/app/Notification.Builder#build()` on the Builder this Style is attached to.
` void` ` https://developer.android.com/reference/android/app/Notification.Style#checkBuilder()() ` ` https://developer.android.com/reference/android/widget/RemoteViews` ` https://developer.android.com/reference/android/app/Notification.Style#getStandardView(int)(int layoutId) ` ` void` ` https://developer.android.com/reference/android/app/Notification.Style#internalSetBigContentTitle(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence title) `

Overrides ContentTitle in the expanded form of the template.
` void` ` https://developer.android.com/reference/android/app/Notification.Style#internalSetSummaryText(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence cs) `

Set the first line of text after the detail section in the expanded form of the template.
` void` ` https://developer.android.com/reference/android/app/Notification.Style#setBuilder(android.app.Notification.Builder)(https://developer.android.com/reference/android/app/Notification.Builder builder) ` From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### CALL_TYPE_INCOMING

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

```
public static final int CALL_TYPE_INCOMING
```

Call type for incoming calls. See `https://developer.android.com/reference/android/app/Notification#EXTRA_CALL_TYPE`.

<br />

Constant Value: 1 (0x00000001)

### CALL_TYPE_ONGOING

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

```
public static final int CALL_TYPE_ONGOING
```

Call type for ongoing calls. See `https://developer.android.com/reference/android/app/Notification#EXTRA_CALL_TYPE`.

<br />

Constant Value: 2 (0x00000002)

### CALL_TYPE_SCREENING

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

```
public static final int CALL_TYPE_SCREENING
```

Call type for calls that are being screened. See `https://developer.android.com/reference/android/app/Notification#EXTRA_CALL_TYPE`.

<br />

Constant Value: 3 (0x00000003)

### CALL_TYPE_UNKNOWN

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

```
public static final int CALL_TYPE_UNKNOWN
```

Unknown call type. See `https://developer.android.com/reference/android/app/Notification#EXTRA_CALL_TYPE`.

<br />

Constant Value: 0 (0x00000000)

## Public methods

### forIncomingCall

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

```
public static Notification.CallStyle forIncomingCall (Person person, 
                PendingIntent declineIntent, 
                PendingIntent answerIntent)
```

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

<br />

| Parameters ||
|---|---|
| `person` | `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`. <br /> |
| `declineIntent` | `PendingIntent`: the intent to be sent when the user taps the decline action. This value cannot be `null`. <br /> |
| `answerIntent` | `PendingIntent`: the intent to be sent when the user taps the answer action. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.CallStyle` | This value cannot be `null`. <br /> |

### forOngoingCall

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

```
public static Notification.CallStyle forOngoingCall (Person person, 
                PendingIntent hangUpIntent)
```

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

<br />

| Parameters ||
|---|---|
| `person` | `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`. <br /> |
| `hangUpIntent` | `PendingIntent`: the intent to be sent when the user taps the hang up action. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.CallStyle` | This value cannot be `null`. <br /> |

### forScreeningCall

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

```
public static Notification.CallStyle forScreeningCall (Person person, 
                PendingIntent hangUpIntent, 
                PendingIntent answerIntent)
```

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 `https://developer.android.com/reference/android/app/Notification.Builder#addAction(android.app.Notification.Action)`, and will have a default `https://developer.android.com/reference/android/app/Notification.Builder#setContentText(java.lang.CharSequence)` for a call that is being screened.

<br />

| Parameters ||
|---|---|
| `person` | `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`. <br /> |
| `hangUpIntent` | `PendingIntent`: the intent to be sent when the user taps the hang up action. This value cannot be `null`. <br /> |
| `answerIntent` | `PendingIntent`: the intent to be sent when the user taps the answer action. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.CallStyle` | This value cannot be `null`. <br /> |

### setAnswerButtonColorHint

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

```
public Notification.CallStyle setAnswerButtonColorHint (int color)
```

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.

<br />

| Parameters ||
|---|---|
| `color` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.CallStyle` | This value cannot be `null`. <br /> |

### setDeclineButtonColorHint

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

```
public Notification.CallStyle setDeclineButtonColorHint (int color)
```

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.

<br />

| Parameters ||
|---|---|
| `color` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.CallStyle` | This value cannot be `null`. <br /> |

### setIsVideo

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

```
public Notification.CallStyle setIsVideo (boolean isVideo)
```

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

<br />

| Parameters ||
|---|---|
| `isVideo` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.CallStyle` | This value cannot be `null`. <br /> |

### setVerificationIcon

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

```
public Notification.CallStyle setVerificationIcon (Icon verificationIcon)
```

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

<br />

| Parameters ||
|---|---|
| `verificationIcon` | `Icon`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.CallStyle` | This value cannot be `null`. <br /> |

### setVerificationText

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

```
public Notification.CallStyle setVerificationText (CharSequence verificationText)
```

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

<br />

| Parameters ||
|---|---|
| `verificationText` | `CharSequence`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.CallStyle` | This value cannot be `null`. <br /> |