2019.01.28 02:31


Android 파일명 변경시


File beforeFileName;
File afterFileName;
 
beforeFileName = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "folder name", "target file name");
afterFileName = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "folder name", "modifi file name");
 
if (beforeFileName.renameTo(afterFileName))
    Toast.makeText(getApplicationContext(), "success!", Toast.LENGTH_SHORT).show();
else
    Toast.makeText(getApplicationContext(), "faile", Toast.LENGTH_SHORT).show();




Posted by injunech