重命名sd卡中的文件名

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

File sdcard = Environment.getExternalStorageDirectory(); 
File from = new File(sdcard,"from.txt"); 
File to = new File(sdcard,"to.txt"); 
from.renameTo(to); 

你可能感兴趣的:(android)