-
-
- private void toggleKeepInSync() {
- CheckBox cb = (CheckBox) getView().findViewById(R.id.fdKeepInSync);
- OCFile file = getFile();
- file.setKeepInSync(cb.isChecked());
- mContainerActivity.getStorageManager().saveFile(file);
-
- /// register the OCFile instance in the observer service to monitor local updates
- Intent observedFileIntent = FileObserverService.makeObservedFileIntent(
- getActivity(),
- file,
- mAccount,
- cb.isChecked());
- getActivity().startService(observedFileIntent);
-
- /// immediate content synchronization
- if (file.keepInSync()) {
- mContainerActivity.getFileOperationsHelper().syncFile(getFile());
- }
- }