WallpaperDescription.Builder


public static final class WallpaperDescription.Builder
extends Object

java.lang.Object
   ↳ android.app.wallpaper.WallpaperDescription.Builder


Builder for the immutable WallpaperDescription class

Summary

Public constructors

Builder()

Creates a new, empty Builder.

Public methods

WallpaperDescription build()

Creates and returns the WallpaperDescription represented by this builder.

WallpaperDescription.Builder setContent(PersistableBundle content)

Set the additional content required to render this wallpaper.

WallpaperDescription.Builder setContextDescription(CharSequence contextDescription)

Set the link text for the action associated with this wallpaper.

WallpaperDescription.Builder setContextUri(Uri contextUri)

Set the Uri for the action associated with this wallpaper, to be shown as a link with the wallpaper information.

WallpaperDescription.Builder setDescription(List<CharSequence> description)

Set the description for this wallpaper.

WallpaperDescription.Builder setId(String id)

Set the id for this wallpaper.

WallpaperDescription.Builder setThumbnail(Uri thumbnail)

Set the thumbnail Uri for this wallpaper.

WallpaperDescription.Builder setTitle(CharSequence title)

Set the title for this wallpaper.

Inherited methods

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.

Public constructors

Builder

public Builder ()

Creates a new, empty Builder.

Public methods

build

public WallpaperDescription build ()

Creates and returns the WallpaperDescription represented by this builder.

setContent

public WallpaperDescription.Builder setContent (PersistableBundle content)

Set the additional content required to render this wallpaper.

When setting additional content (asset id, etc.), best practice is to set an ID as well. This allows WallpaperManager and other code to distinguish between different wallpapers handled by this component.

Parameters
content PersistableBundle: additional content, or an empty bundle for none

setContextDescription

public WallpaperDescription.Builder setContextDescription (CharSequence contextDescription)

Set the link text for the action associated with this wallpaper.

Parameters
contextDescription CharSequence: the link text, or null for default text

setContextUri

public WallpaperDescription.Builder setContextUri (Uri contextUri)

Set the Uri for the action associated with this wallpaper, to be shown as a link with the wallpaper information.

Parameters
contextUri Uri: the action Uri, or null for no action

setDescription

public WallpaperDescription.Builder setDescription (List<CharSequence> description)

Set the description for this wallpaper. Each array element should be shown on a different line.

Parameters
description List: the description, or an empty list for none

setId

public WallpaperDescription.Builder setId (String id)

Set the id for this wallpaper.

IDs are used to distinguish among different instances of wallpapers rendered by the same component, and should be unique among all wallpapers for that component.

Parameters
id String: the id, or null for none

setThumbnail

public WallpaperDescription.Builder setThumbnail (Uri thumbnail)

Set the thumbnail Uri for this wallpaper.

Parameters
thumbnail Uri: the thumbnail Uri, or null for none

setTitle

public WallpaperDescription.Builder setTitle (CharSequence title)

Set the title for this wallpaper.

Parameters
title CharSequence: the title, or null for none