Back to project page TheFirstMyth01.
The source code is released under:
MIT License
If you think the Android project TheFirstMyth01 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.game.commen; /*w w w . j a v a 2s . co m*/ import java.io.IOException; import java.io.InputStream; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; public class BitmapUtil { public static Bitmap getBitmapFromAssets(Context ctx, String path) { InputStream iis; Bitmap bitmap = null; try { iis = ctx.getAssets().open(path); bitmap= BitmapFactory.decodeStream(iis); iis=null; return bitmap; } catch (IOException e) { e.printStackTrace(); return null; } finally{ bitmap=null; System.gc(); } } }