public class AuthTask extends AsyncTask<Account,Void,CloverAuth.AuthResult>
AsyncTask.Status
SERIAL_EXECUTOR, THREAD_POOL_EXECUTOR
Constructor and Description |
---|
AuthTask(Activity activity)
Create a new
AuthTask . |
Modifier and Type | Method and Description |
---|---|
protected CloverAuth.AuthResult |
doInBackground(Account... accounts) |
String |
getErrorMessage()
Return the error message that was generated when authentication failed, or
null
if authentication succeeded. |
Exception |
getException()
Return the
Exception that was thrown when authentication failed, or null
if authentication succeeded. |
protected void |
onAuthCanceled(OperationCanceledException e)
Called on the main thread if
OperationCanceledException was
thrown during authentication. |
protected void |
onAuthComplete(boolean success,
CloverAuth.AuthResult result)
Called on the main thread after the auth process has completed.
|
protected void |
onAuthenticatorException(AuthenticatorException e)
Called on the main thread if
AuthenticatorException was
thrown during authentication. |
protected void |
onIOException(IOException e)
Called on the main thread if
IOException was thrown during authentication. |
protected void |
onPostExecute(CloverAuth.AuthResult result)
Calls callback methods after the authentication attempt completes.
|
cancel, execute, execute, executeOnExecutor, get, get, getStatus, isCancelled, onCancelled, onCancelled, onPreExecute, onProgressUpdate, publishProgress
public AuthTask(Activity activity)
AuthTask
.activity
- the Activity
that initiated authentication with the Clover service.public Exception getException()
Exception
that was thrown when authentication failed, or null
if authentication succeeded.public String getErrorMessage()
null
if authentication succeeded.protected CloverAuth.AuthResult doInBackground(Account... accounts)
doInBackground
in class AsyncTask<Account,Void,CloverAuth.AuthResult>
protected void onPostExecute(CloverAuth.AuthResult result)
onPostExecute
in class AsyncTask<Account,Void,CloverAuth.AuthResult>
protected void onAuthComplete(boolean success, CloverAuth.AuthResult result)
success
- true
if authentication was successfulresult
- the authentication result, or null
if an exception was thrownprotected void onAuthCanceled(OperationCanceledException e)
OperationCanceledException
was
thrown during authentication.protected void onAuthenticatorException(AuthenticatorException e)
AuthenticatorException
was
thrown during authentication.protected void onIOException(IOException e)
IOException
was thrown during authentication.