- try{
- if (mClient == null) {
- if (mAccount != null && mContext != null) {
- mClient = OwnCloudClientUtils.createOwnCloudClient(mAccount, mContext);
- } else {
- throw new IllegalStateException("Trying to run a remote operation asynchronously with no client instance or account");
+ boolean repeat = false;
+ do {
+ try{
+ if (mClient == null) {
+ if (mAccount != null && mContext != null) {
+ if (mCallerActivity != null) {
+ mClient = OwnCloudClientUtils.createOwnCloudClient(mAccount, mContext, mCallerActivity);
+ } else {
+ mClient = OwnCloudClientUtils.createOwnCloudClient(mAccount, mContext);
+ }
+ } else {
+ throw new IllegalStateException("Trying to run a remote operation asynchronously with no client instance or account");
+ }