Example usage for android.widget ImageSwitcher setImageDrawable

List of usage examples for android.widget ImageSwitcher setImageDrawable

Introduction

In this page you can find the example usage for android.widget ImageSwitcher setImageDrawable.

Prototype

public void setImageDrawable(Drawable drawable) 

Source Link

Document

Sets a new drawable on the ImageSwitcher.

Usage

From source file:com.geeker.door.imgcache.ImageDownloader.java

/**
 * bitmapzho//from   www.jav a  2s  .  c o m
 * 
 * @param view
 * @param bitmap
 */
public void setBitmapByView(View view, Bitmap bitmap) {
    if (view instanceof ImageView) {
        ImageView imageView = (ImageView) view;
        imageView.setImageBitmap(bitmap);
    } else if (view instanceof ImageSwitcher) {
        ImageSwitcher imageSwitcher = (ImageSwitcher) view;
        imageSwitcher.setImageDrawable(new BitmapDrawable(bitmap));
    }
}