Skip to content

Instantly share code, notes, and snippets.

@uebi-belli
Created April 19, 2016 12:46
Show Gist options
  • Save uebi-belli/3c07323c8055a3b66ccac0d388b2b013 to your computer and use it in GitHub Desktop.
Save uebi-belli/3c07323c8055a3b66ccac0d388b2b013 to your computer and use it in GitHub Desktop.
public static Bitmap getBitmapExt(Context context, String name){
Bitmap bitmap = null;
try {
if(expansionFile == null){
PackageInfo pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
expansionFile = APKExpansionSupport.getAPKExpansionZipFile(context, pInfo.versionCode, 0);
}
InputStream is = expansionFile.getInputStream("images/" + name + ".png");
bitmap = BitmapFactory.decodeStream(is);
}
catch (Exception e){
e.printStackTrace();
}
return bitmap;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment