Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;

import android.widget.ImageView;

public class Main {
    public static void clearImageView(ImageView imageView) {
        if (!(imageView.getDrawable() instanceof BitmapDrawable)) {
            return;
        }
        Bitmap drawable = ((BitmapDrawable) imageView.getDrawable()).getBitmap();
        if (drawable != null && !drawable.isRecycled()) {
            drawable.recycle();
        }
        imageView.setImageDrawable(null);
    }
}