private void copyMB() {\n AssetManager assetManager = this.getResources().getAssets();\n String[] files = null;\n try {\n files = assetManager.list(assetDir);\n } catch (Exception e) {\n e.printStackTrace();\n }\n for(int i=0; i<files.length; i++) {\n InputStream in = null;\n FileOutputStream fos;\n try {\n in = assetManager.open(assetDir+"/" + files[i]);\n\n fos = openFileOutput(files[i], Context.MODE_PRIVATE);\n copyFile(in, fos);\n in.close();\n in = null;\n fos.flush();\n fos.close();\n fos = null;\n } catch(Exception e) {\n e.printStackTrace();\n } \n }\n}\nprivate void copyFile(InputStream in, OutputStream out) throws IOException {\n\n byte[] buffer = new byte[1024];\n int read;\n\n …Run Code Online (Sandbox Code Playgroud) android ×1