Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.Bitmap;

import android.graphics.BitmapFactory;

import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;

public class Main {
    @SuppressWarnings("deprecation")
    public static Drawable bytesToDrawable(byte[] bytes) {
        Drawable drawable = null;
        int length = bytes.length;
        Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, length);
        drawable = new BitmapDrawable(bitmap);
        return drawable;
    }
}