- private class AuthTask extends AsyncTask<Context, Void, WebdavClient> {
-
- @Override
- protected WebdavClient doInBackground(Context... params) {
- WebdavClient client = null;
- try {
- client = OwnCloudClientFactory.createOwnCloudClient(mAccount, (Context) params[0] );
- } catch (OperationCanceledException e) {
- Log.e(TAG, "Error while trying to access to " + mAccount.name, e);
- e.printStackTrace();
- } catch (AuthenticatorException e) {
- Log.e(TAG, "Error while trying to access to " + mAccount.name, e);
- e.printStackTrace();
- } catch (AccountNotFoundException e) {
- Log.e(TAG, "Error while trying to access to " + mAccount.name, e);
- e.printStackTrace();
- } catch (IOException e) {
- Log.e(TAG, "Error while trying to access to " + mAccount.name, e);
- e.printStackTrace();
- } catch (IllegalStateException e) {
- Log.e(TAG, "Error while trying to access to " + mAccount.name, e);
- e.printStackTrace();
- }
- return client;
- }
-
- @Override
- protected void onPostExecute(WebdavClient result) {
- // TODO Auto-generated method stub
- super.onPostExecute(result);
- mClient = result;
- }
-
- }