public static abstract class Notification.Style
extends Object

Known direct subclasses

Notification.BigPictureStyle Helper class for generating large-format notifications that include a large image attachment. 
Notification.BigTextStyle Helper class for generating large-format notifications that include a lot of text. 
Notification.CallStyle Helper class for generating large-format notifications that include a caller and required actions, such as an incoming call with answer / decline. 
Notification.DecoratedCustomViewStyle Notification style for custom views that are decorated by the system

Instead of providing a notification that is completely custom, a developer can set this style and still obtain system decorations like the notification header with the expand affordance and actions. 

Notification.InboxStyle Helper class for generating large-format notifications that include a list of (up to 5) strings. 
Notification.MediaStyle Notification style for media playback notifications. 
Notification.MessagingStyle Helper class for generating large-format notifications that include multiple back-and-forth messages of varying types between any number of people. 
Notification.MetricStyle A notification style which shows up to 3 metrics when expanded. 
Notification.ProgressStyle A Notification Style used to define a notification whose expanded state includes a highly customizable progress bar with segments, points, a custom tracker icon, and custom icons at the start and end of the progress bar. 


An object that can apply a rich notification style to a Notification.Builder object.

Summary

Fields

protected Notification.Builder mBuilder

Public constructors

Style()

This constructor is deprecated. public access to the constructor of Style() is only useful for creating custom subclasses, but that has actually been impossible due to hidden abstract methods, so this constructor is now officially deprecated to clarify that this is intended to be disallowed.

Public methods

Notification build()

Calls Notification.Builder.build() on the Builder this Style is attached to.

void setBuilder(Notification.Builder builder)

Protected methods

void checkBuilder()
RemoteViews getStandardView(int layoutId)
void internalSetBigContentTitle(CharSequence title)

Overrides ContentTitle in the expanded form of the template.

void internalSetSummaryText(CharSequence cs)

Set the first line of text after the detail section in the expanded form of the template.

Inherited methods

From class java.lang.Object

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(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 wait(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 wait()

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

Fields

Public constructors

Style

public Style ()

This constructor is deprecated.
public access to the constructor of Style() is only useful for creating custom subclasses, but that has actually been impossible due to hidden abstract methods, so this constructor is now officially deprecated to clarify that this is intended to be disallowed.

Public methods

build

public Notification build ()

Calls 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.

Returns
Notification the fully constructed Notification

setBuilder

public void setBuilder (Notification.Builder builder)
Parameters
builder Notification.Builder

Protected methods

checkBuilder

protected void checkBuilder ()

getStandardView

protected RemoteViews getStandardView (int layoutId)
Parameters
layoutId int
Returns
RemoteViews

internalSetBigContentTitle

protected void internalSetBigContentTitle (CharSequence title)

Overrides ContentTitle in the expanded form of the template. This defaults to the value passed to setContentTitle().

Parameters
title CharSequence

internalSetSummaryText

protected void internalSetSummaryText (CharSequence cs)

Set the first line of text after the detail section in the expanded form of the template.

Parameters
cs CharSequence

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-02-26 UTC.