# NotificationCompat.CallStyle

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/app/NotificationCompat.java+class:androidx.core.app.NotificationCompat.CallStyle) Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)

*** ** * ** ***


```
public class NotificationCompat.CallStyle extends NotificationCompat.Style
```

<br />

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

*** ** * ** ***

Helper class for generating large-format notifications that include a caller and required actions, and indicate an incoming call. If the platform does not provide large-format notifications, this method has no effect. The user will always see the normal notification view. This class is a "rebuilder": It attaches to a Builder object and modifies its behavior, like so:

```
Notification notification = new NotificationCompat.Builder(mContext)
    .setSmallIcon(R.drawable.new_post)
    .setStyle(
            new Notification.CallStyle.forIncomingCall(caller, declineIntent, answerIntent))
    .build();
```
Note that for CallStyle Notifications on API versions before 31 to be ranked as they are in API versions 31+, they must be associated with a foreground service. Additionally, CallStyle Notifications on API versions before 31 can achieve the similar ranking by marking the Notification as colorized, using `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder#setColorized(boolean)`.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#CALL_TYPE_INCOMING() = 1` Call type for incoming calls. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#CALL_TYPE_ONGOING() = 2` Call type for ongoing calls. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#CALL_TYPE_SCREENING() = 3` Call type for calls that are being screened. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#CALL_TYPE_UNKNOWN() = 0` Unknown call type. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#CallStyle()()` |
| `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#CallStyle(androidx.core.app.NotificationCompat.Builder)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder builder)` Creates a CallStyle linked to a notification builder. |

| ### Public methods |
|---|---|
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#forIncomingCall(androidx.core.app.Person,android.app.PendingIntent,android.app.PendingIntent)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/Person person, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html declineIntent, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html answerIntent )` Creates a CallStyle for an incoming call. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#forOngoingCall(androidx.core.app.Person,android.app.PendingIntent)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/Person person, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html hangUpIntent)` Creates a CallStyle for an ongoing call. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#forScreeningCall(androidx.core.app.Person,android.app.PendingIntent,android.app.PendingIntent)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/Person person, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html hangUpIntent, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html answerIntent )` Creates a CallStyle for a call that is being screened. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#setAnswerButtonColorHint(int)(@https://developer.android.com/reference/androidx/annotation/ColorInt int color)` Sets an optional color to be used as a hint for the Answer action button's color. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#setDeclineButtonColorHint(int)(@https://developer.android.com/reference/androidx/annotation/ColorInt int color)` Sets an optional color to be used as a hint for the Decline or Hang Up action button's color. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.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://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#setVerificationIcon(android.graphics.Bitmap)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/Bitmap.html verificationIcon)` Sets an optional icon to be displayed with `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#setVerificationText(java.lang.CharSequence)` as a verification status of the caller. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#setVerificationIcon(android.graphics.drawable.Icon)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/drawable/Icon.html verificationIcon)` Sets an optional icon to be displayed with `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#setVerificationText(java.lang.CharSequence)` as a verification status of the caller. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#setVerificationText(java.lang.CharSequence)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html verificationText)` Sets optional text to be displayed with an `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#setVerificationIcon(android.graphics.drawable.Icon)` as a verification status of the caller. |

| ### Inherited methods |
|---|
| From [androidx.core.app.NotificationCompat.Style](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Style) |---|---| | `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/app/Notification.html` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Style#build()()` If this Style object has been set on a notification builder, this method will build that notification and return it. | | `void` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Style#setBuilder(androidx.core.app.NotificationCompat.Builder)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder builder)` Link this rich notification style with a notification builder. | |

## Constants

### CALL_TYPE_INCOMING

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

```
public static final int CALL_TYPE_INCOMING = 1
```

Call type for incoming calls. See `https://developer.android.com/reference/androidx/core/app/NotificationCompat#EXTRA_CALL_TYPE()`.

### CALL_TYPE_ONGOING

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

```
public static final int CALL_TYPE_ONGOING = 2
```

Call type for ongoing calls. See `https://developer.android.com/reference/androidx/core/app/NotificationCompat#EXTRA_CALL_TYPE()`.

### CALL_TYPE_SCREENING

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

```
public static final int CALL_TYPE_SCREENING = 3
```

Call type for calls that are being screened. See `https://developer.android.com/reference/androidx/core/app/NotificationCompat#EXTRA_CALL_TYPE()`.

### CALL_TYPE_UNKNOWN

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

```
public static final int CALL_TYPE_UNKNOWN = 0
```

Unknown call type. See `https://developer.android.com/reference/androidx/core/app/NotificationCompat#EXTRA_CALL_TYPE()`.

## Public constructors

### CallStyle

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

```
public CallStyle()
```

### CallStyle

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

```
public CallStyle(@Nullable NotificationCompat.Builder builder)
```

Creates a CallStyle linked to a notification builder.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder builder` | the notification builder to link |

## Public methods

### forIncomingCall

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

```
public static @NonNull NotificationCompat.CallStyle forIncomingCall(
    @NonNull Person person,
    @NonNull PendingIntent declineIntent,
    @NonNull PendingIntent answerIntent
)
```

Creates 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/androidx/core/app/NotificationCompat.Builder#addAction(androidx.core.app.NotificationCompat.Action)`, and will have a default `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder#setContentText(java.lang.CharSequence)` for an incoming call.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/Person person` | the person displayed as the caller the person also needs to have a non-empty name associated with it |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html declineIntent` | the intent to be sent when the user taps the decline action |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html answerIntent` | the intent to be sent when the user taps the answer action |

### forOngoingCall

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

```
public static @NonNull NotificationCompat.CallStyle forOngoingCall(@NonNull Person person, @NonNull PendingIntent hangUpIntent)
```

Creates 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/androidx/core/app/NotificationCompat.Builder#addAction(androidx.core.app.NotificationCompat.Action)`, and will have a default `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder#setContentText(java.lang.CharSequence)` for an ongoing call.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/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 |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html hangUpIntent` | the intent to be sent when the user taps the hang up action |

### forScreeningCall

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

```
public static @NonNull NotificationCompat.CallStyle forScreeningCall(
    @NonNull Person person,
    @NonNull PendingIntent hangUpIntent,
    @NonNull PendingIntent answerIntent
)
```

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/Person person` | the person displayed as the caller the person also needs to have a non-empty name associated with it |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html hangUpIntent` | the intent to be sent when the user taps the hang up action |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html answerIntent` | the intent to be sent when the user taps the answer action |

### setAnswerButtonColorHint

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

```
public @NonNull NotificationCompat.CallStyle setAnswerButtonColorHint(@ColorInt int color)
```

Sets an 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.

### setDeclineButtonColorHint

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

```
public @NonNull NotificationCompat.CallStyle setDeclineButtonColorHint(@ColorInt int color)
```

Sets an 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.

### setIsVideo

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

```
public @NonNull NotificationCompat.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.

### setVerificationIcon

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

```
public @NonNull NotificationCompat.CallStyle setVerificationIcon(@Nullable Bitmap verificationIcon)
```

Sets an optional icon to be displayed with `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#setVerificationText(java.lang.CharSequence)` as a verification status of the caller.

### setVerificationIcon

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

```
public @NonNull NotificationCompat.CallStyle setVerificationIcon(@Nullable Icon verificationIcon)
```

Sets an optional icon to be displayed with `https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle#setVerificationText(java.lang.CharSequence)` as a verification status of the caller.

### setVerificationText

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

```
public @NonNull NotificationCompat.CallStyle setVerificationText(@Nullable CharSequence verificationText)
```

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