I have a backup routine that copies everything from one folder to an external SD card which works perfectly. I'm trying to get an nice popup dialog box that shows when it's running but it just isn't showing. Doesn't even attempt to run (but the backup does complete).
Here's my code at the moment:
public void doBackup(View view) throws IOException{
ProgressDialog pd = new ProgressDialog(this);
pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pd.setMessage("Running backup. Do not unplug drive");
pd.setIndeterminate(true);
pd.setCancelable(false);
pd.show();
File source = new File("/mnt/extSdCard/DirectEnquiries");
File dest = new File("/mnt/UsbDriveA/Backup");
copyDirectory(source, dest);
pd.dismiss();
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…