daily pastebin goal
54%
SHARE
TWEET

Untitled

a guest Aug 12th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     private void CUSTOM() {
  2.         try {
  3.             View view = inflate(R.layout.dialog, null);
  4.             EditText mBackupFileName = (EditText) view.findViewById(R.id.foldername);
  5.             String title = mBackupFileName.getText().toString();
  6.             if (showDebugOutput) Log.wtf(PREF_NAME, "Backing up bootanimation to /sdcard...");
  7.             FileInputStream in = new FileInputStream(Environment.getDataDirectory() + "/local/bootanimation.zip");
  8.             FileOutputStream out = new FileOutputStream(Environment.getExternalStorageDirectory() + "/bootanimation/backup/" + title + ".zip");
  9.             File SDCARD_BOOTANIMATION = new File(Environment.getExternalStorageDirectory() + "/bootanimation/backup/" + title + ".zip");
  10.             byte[] buf = new byte[1024];
  11.             int i = 0;
  12.             while ((i = in.read(buf)) != -1) {
  13.                 out.write(buf, 0, i);
  14.             }
  15.             in.close();
  16.             out.close();
  17.             if(SDCARD_BOOTANIMATION.exists()){
  18.                 Toast.makeText(getBaseContext(), "Your bootanimation was backed up as " + title + ".zip", 5).show();
  19.             }
  20.         } catch(IOException e) {
  21.             if (showDebugOutput) Log.wtf(PREF_NAME, "Error copying file");
  22.         }
  23.      }
RAW Paste Data
Top