Fix issue 540

@booms-edv.
Fix for https://github.com/owncloud/android/issues/540