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 class

ImageSpan

extends DynamicDrawableSpan
java.lang.Object
   ↳ android.text.style.CharacterStyle
     ↳ android.text.style.MetricAffectingSpan
       ↳ android.text.style.ReplacementSpan
         ↳ android.text.style.DynamicDrawableSpan
           ↳ android.text.style.ImageSpan

Summary

[Expand]
Inherited Constants
From class android.text.style.DynamicDrawableSpan
[Expand]
Inherited Fields
From class android.text.style.DynamicDrawableSpan
Public Constructors
ImageSpan ( Bitmap b)
This constructor was deprecated in API level 4. Use ImageSpan(Context, Bitmap) instead.
ImageSpan ( Bitmap b, int verticalAlignment)
This constructor was deprecated in API level 4. Use {@link #ImageSpan(Context, Bitmap, int) instead.
ImageSpan ( Context context, Bitmap b)
ImageSpan ( Context context, Bitmap b, int verticalAlignment)
ImageSpan ( Drawable d)
ImageSpan ( Drawable d, int verticalAlignment)
ImageSpan ( Drawable d, String source)
ImageSpan ( Drawable d, String source, int verticalAlignment)
ImageSpan ( Context context, Uri uri)
ImageSpan ( Context context, Uri uri, int verticalAlignment)
ImageSpan ( Context context, int resourceId)
ImageSpan ( Context context, int resourceId, int verticalAlignment)
Public Methods
Drawable getDrawable ()
Your subclass must implement this method to provide the bitmap to be drawn.
String getSource ()
Returns the source string that was saved during construction.
[Expand]
Inherited Methods
From class android.text.style.DynamicDrawableSpan
From class android.text.style.ReplacementSpan
From class android.text.style.MetricAffectingSpan
From class android.text.style.CharacterStyle
From class java.lang.Object

Public Constructors

public ImageSpan ( Bitmap b)

Added in API level 1

This constructor was deprecated in API level 4.
Use ImageSpan(Context, Bitmap) instead.

public ImageSpan ( Bitmap b, int verticalAlignment)

Added in API level 3

This constructor was deprecated in API level 4.
Use {@link #ImageSpan(Context, Bitmap, int) instead.

public ImageSpan ( Context context, Bitmap b)

Added in API level 4

public ImageSpan ( Context context, Bitmap b, int verticalAlignment)

Added in API level 4

Parameters
verticalAlignment one of ALIGN_BOTTOM or ALIGN_BASELINE .

public ImageSpan ( Drawable d)

Added in API level 1

public ImageSpan ( Drawable d, int verticalAlignment)

Added in API level 3

Parameters
verticalAlignment one of ALIGN_BOTTOM or ALIGN_BASELINE .

public ImageSpan ( Drawable d, String source)

Added in API level 1

public ImageSpan ( Drawable d, String source, int verticalAlignment)

Added in API level 3

Parameters
verticalAlignment one of ALIGN_BOTTOM or ALIGN_BASELINE .

public ImageSpan ( Context context, Uri uri)

Added in API level 1

public ImageSpan ( Context context, Uri uri, int verticalAlignment)

Added in API level 3

Parameters
verticalAlignment one of ALIGN_BOTTOM or ALIGN_BASELINE .

public ImageSpan ( Context context, int resourceId)

Added in API level 1

public ImageSpan ( Context context, int resourceId, int verticalAlignment)

Added in API level 3

Parameters
verticalAlignment one of ALIGN_BOTTOM or ALIGN_BASELINE .

Public Methods

public Drawable getDrawable ()

Added in API level 1

Your subclass must implement this method to provide the bitmap to be drawn. The dimensions of the bitmap must be the same from each call to the next.

public String getSource ()

Added in API level 1

Returns the source string that was saved during construction.