Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var path = android.os.Environment.getExternalStorageDirectory().getAbsolutePath() + "/games/com.mojang/minecraftpe/mods";
- var imageIcon = " /*Base64 code here*/ ";
- Base64Decode(android.util.Base64.decode(imageIcon, 0), path + "/imagename.png");
- function Base64Decode(byteArray, Path) {
- try {
- var File = new java.io.File(Path);
- if (!File.exists()) {
- File.createNewFile();
- var Stream = new java.io.FileOutputStream(File);
- Stream.write(byteArray);
- Stream.close();
- }
- } catch (err) {
- print(err);
- }
- }
- var imageBckgrnd = new android.graphics.BitmapFactory.decodeFile(android.os.Environment.getExternalStorageDirectory().getAbsolutePath() + "/games/com.mojang/minecraftpe/mods/imagename.png");
- var imageBackground = new android.graphics.drawable.BitmapDrawable(imageBckgrnd);
- //Now use menu.setBackgroundDrawable(imageBackground);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement