Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Base64;

public class Main {
    public static Bitmap getBitmap(Context context, String str) {
        if (str != null && str.length() > 0) {
            byte[] decode = Base64.decode(str, Base64.DEFAULT);
            return BitmapFactory.decodeByteArray(decode, 0, decode.length);
        }
        return null;
    }
}