Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void CUSTOM() {
- try {
- View view = inflate(R.layout.dialog, null);
- EditText mBackupFileName = (EditText) view.findViewById(R.id.foldername);
- String title = mBackupFileName.getText().toString();
- if (showDebugOutput) Log.wtf(PREF_NAME, "Backing up bootanimation to /sdcard...");
- FileInputStream in = new FileInputStream(Environment.getDataDirectory() + "/local/bootanimation.zip");
- FileOutputStream out = new FileOutputStream(Environment.getExternalStorageDirectory() + "/bootanimation/backup/" + title + ".zip");
- File SDCARD_BOOTANIMATION = new File(Environment.getExternalStorageDirectory() + "/bootanimation/backup/" + title + ".zip");
- byte[] buf = new byte[1024];
- int i = 0;
- while ((i = in.read(buf)) != -1) {
- out.write(buf, 0, i);
- }
- in.close();
- out.close();
- if(SDCARD_BOOTANIMATION.exists()){
- Toast.makeText(getBaseContext(), "Your bootanimation was backed up as " + title + ".zip", 5).show();
- }
- } catch(IOException e) {
- if (showDebugOutput) Log.wtf(PREF_NAME, "Error copying file");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement