سلام
کپی فایل همراه با Progress:
// Params are input and output files, progress in Long size of
// data transferred, Result is Boolean success.
public class MyTask extends AsyncTask<File,Long,Boolean> {
ProgressDialog progress;
protected void onPreExecute() {
progress = ProgressDialog.show(ctx,"","Loading...",true);
}
protected Boolean doInBackground(File... files) {
copyFiles(files[0],files[1]);
return true;
}
protected void onPostExecute(Boolean success) {
progress.dismiss();
// Show dialog with result
}
protected void onProgressUpdate(Long... values) {
progress.setMessage("Transferred " + values[0] + " bytes");
}
}
برای اجرا:
MyTask task = new MyTask();
task.execute(src,dest);
منبع:http://stackoverflow.com/a/6053982/478162