public class AttachFileTask extends android.os.AsyncTask<java.io.File,java.io.File,AttachFileTask.Result> implements android.content.DialogInterface.OnCancelListener
This class may make use of IO that is not through the default abstraction layer in order to support the following use-cases:
Modifier and Type | Class and Description |
---|---|
static class |
AttachFileTask.Result
Result of import attempt
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.Runnable |
_callback |
protected android.content.Context |
_context |
protected android.app.ProgressDialog |
_progressDialog |
protected java.lang.String |
_uid |
static int |
FlagPromptOverwrite |
Constructor and Description |
---|
AttachFileTask(android.content.Context context,
java.lang.String uid,
java.lang.String callsign) |
AttachFileTask(android.content.Context context,
java.lang.String uid,
java.lang.String callsign,
java.lang.Runnable callback) |
Modifier and Type | Method and Description |
---|---|
protected AttachFileTask.Result |
doInBackground(java.io.File... params) |
int |
getFlags()
Get the style property value
|
void |
onCancel(android.content.DialogInterface dialog) |
protected void |
onPostExecute(AttachFileTask.Result result) |
protected void |
onPreExecute() |
protected void |
onProgressUpdate(java.io.File... files)
Currently, use this only to ask user prior to overwriting existing file with the same name
which has already been imported
|
void |
setCallback(java.lang.Runnable callback) |
void |
setFlags(int flags)
Set the flags property value
|
void |
setProvider(IOProvider provider)
Set the
IOProvider to use to read the source file. |
protected final android.content.Context _context
protected java.lang.Runnable _callback
protected final java.lang.String _uid
protected android.app.ProgressDialog _progressDialog
public static final int FlagPromptOverwrite
public AttachFileTask(android.content.Context context, java.lang.String uid, java.lang.String callsign)
public AttachFileTask(android.content.Context context, java.lang.String uid, java.lang.String callsign, java.lang.Runnable callback)
public void setCallback(java.lang.Runnable callback)
public int getFlags()
public void setFlags(int flags)
flags
- a bitfieldpublic void setProvider(IOProvider provider)
IOProvider
to use to read the source file. Specify
null
to use the IOProvider
instance registered with
IOProviderFactory
.provider
- The IOProvider
to use to access the source file
during task executionprotected void onPreExecute()
onPreExecute
in class android.os.AsyncTask<java.io.File,java.io.File,AttachFileTask.Result>
protected AttachFileTask.Result doInBackground(java.io.File... params)
doInBackground
in class android.os.AsyncTask<java.io.File,java.io.File,AttachFileTask.Result>
public void onCancel(android.content.DialogInterface dialog)
onCancel
in interface android.content.DialogInterface.OnCancelListener
protected void onPostExecute(AttachFileTask.Result result)
onPostExecute
in class android.os.AsyncTask<java.io.File,java.io.File,AttachFileTask.Result>
protected void onProgressUpdate(java.io.File... files)
onProgressUpdate
in class android.os.AsyncTask<java.io.File,java.io.File,AttachFileTask.Result>
files
- Files being attached