com.drismo.gui
Class ViewArchive.RenameTrip

java.lang.Object
  extended by android.os.AsyncTask<java.lang.String[],java.lang.Void,java.lang.Boolean>
      extended by com.drismo.gui.ViewArchive.RenameTrip
Enclosing class:
ViewArchive

private class ViewArchive.RenameTrip
extends android.os.AsyncTask<java.lang.String[],java.lang.Void,java.lang.Boolean>

Rename a trip file, while a ProgressDialog (spinner) runs in the foreground.


Nested Class Summary
 
Nested classes/interfaces inherited from class android.os.AsyncTask
android.os.AsyncTask.Status
 
Field Summary
(package private)  java.lang.String[] filenames
           
(package private)  java.lang.String newFilename
           
(package private)  java.lang.String oldFilename
           
(package private)  int updatedTripNr
           
 
Constructor Summary
private ViewArchive.RenameTrip()
           
 
Method Summary
protected  java.lang.Boolean doInBackground(java.lang.String[]... param)
          Rename a file from the application directory
protected  void onPostExecute(java.lang.Boolean renamed)
          Close the ProgressDialog, report success of failure to the user via Toast and restart the activity to show the archive with updated content.
protected  void onPreExecute()
          Prepare a spinner for this task
 
Methods inherited from class android.os.AsyncTask
cancel, execute, get, get, getStatus, isCancelled, onCancelled, onProgressUpdate, publishProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filenames

java.lang.String[] filenames

oldFilename

java.lang.String oldFilename

newFilename

java.lang.String newFilename

updatedTripNr

int updatedTripNr
Constructor Detail

ViewArchive.RenameTrip

private ViewArchive.RenameTrip()
Method Detail

onPreExecute

protected void onPreExecute()
Prepare a spinner for this task

Overrides:
onPreExecute in class android.os.AsyncTask<java.lang.String[],java.lang.Void,java.lang.Boolean>

doInBackground

protected java.lang.Boolean doInBackground(java.lang.String[]... param)
Rename a file from the application directory

Specified by:
doInBackground in class android.os.AsyncTask<java.lang.String[],java.lang.Void,java.lang.Boolean>
Parameters:
param - A string array with both the old filename and what to rename it to.
Returns:
Result of the rename action.

onPostExecute

protected void onPostExecute(java.lang.Boolean renamed)
Close the ProgressDialog, report success of failure to the user via Toast and restart the activity to show the archive with updated content.

Overrides:
onPostExecute in class android.os.AsyncTask<java.lang.String[],java.lang.Void,java.lang.Boolean>
Parameters:
renamed - True if the file was renamed. False otherwise.