Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public static interface

Drawable.Callback

android.graphics.drawable.Drawable.Callback
Known Indirect Subclasses

Class Overview

Implement this interface if you want to create an animated drawable that extends Drawable . Upon retrieving a drawable, use setCallback(android.graphics.drawable.Drawable.Callback) to supply your implementation of the interface to the drawable; it uses this interface to schedule and execute animation changes.

Summary

Public Methods
abstract void invalidateDrawable ( Drawable who)
Called when the drawable needs to be redrawn.
abstract void scheduleDrawable ( Drawable who, Runnable what, long when)
A Drawable can call this to schedule the next frame of its animation.
abstract void unscheduleDrawable ( Drawable who, Runnable what)
A Drawable can call this to unschedule an action previously scheduled with scheduleDrawable(Drawable, Runnable, long) .

Public Methods

public abstract void invalidateDrawable ( Drawable who)

Added in API level 1

Called when the drawable needs to be redrawn. A view at this point should invalidate itself (or at least the part of itself where the drawable appears).

Parameters
who The drawable that is requesting the update.

public abstract void scheduleDrawable ( Drawable who, Runnable what, long when)

Added in API level 1

A Drawable can call this to schedule the next frame of its animation. An implementation can generally simply call postAtTime(Runnable, Object, long) with the parameters (what, who, when) to perform the scheduling.

Parameters
who The drawable being scheduled.
what The action to execute.
when The time (in milliseconds) to run. The timebase is uptimeMillis()

public abstract void unscheduleDrawable ( Drawable who, Runnable what)

Added in API level 1

A Drawable can call this to unschedule an action previously scheduled with scheduleDrawable(Drawable, Runnable, long) . An implementation can generally simply call removeCallbacks(Runnable, Object) with the parameters (what, who) to unschedule the drawable.

Parameters
who The drawable being unscheduled.
what The action being unscheduled.