to top
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

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

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

? Examples
ImageSpan( Context context, Bitmap b)

? Examples
ImageSpan( Context context, Bitmap b, int verticalAlignment)

? Examples
ImageSpan( Drawable d)

? Examples
ImageSpan( Drawable d, int verticalAlignment)

? Examples
ImageSpan( Drawable d, String source)

? Examples
ImageSpan( Drawable d, String source, int verticalAlignment)

? Examples
ImageSpan( Context context, Uri uri)

? Examples
ImageSpan( Context context, Uri uri, int verticalAlignment)

? Examples
ImageSpan( Context context, int resourceId)

? Examples
ImageSpan( Context context, int resourceId, int verticalAlignment)
Public Methods

? Examples
Drawable getDrawable()
Your subclass must implement this method to provide the bitmap to be drawn.

? Examples
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.

No examples for this method.
Frequently called with: [Clear]
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. The original page is available here.