Testing synchronization cancelation

This commit is contained in:
David A. Velasco 2012-07-16 12:54:18 +02:00
parent c0645e6832
commit 0f2376806f
2 changed files with 7 additions and 0 deletions

View file

@ -265,5 +265,11 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
}
getContext().sendStickyBroadcast(i);
}
@Override
public void onSyncCanceled() {
Log.d(TAG, "sync is being cancelled !! ************************************************");
super.onSyncCanceled();
}
}

View file

@ -78,6 +78,7 @@ public class AccountSelectActivity extends SherlockListActivity implements
AccountUtils.setCurrentOwnCloudAccount(this, accountName);
// trigger synchronization when current account is changed
ContentResolver.cancelSync(null, "org.owncloud");
Bundle bundle = new Bundle();
bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
ContentResolver.requestSync(AccountUtils.getCurrentOwnCloudAccount(this), "org.owncloud", bundle);