- /**
- * Launches the account creation activity. To use when no ownCloud account is available
- */
- private void createFirstAccount() {
- Intent intent = new Intent(android.provider.Settings.ACTION_ADD_ACCOUNT);
- intent.putExtra(android.provider.Settings.EXTRA_AUTHORITIES, new String[] { AccountAuthenticator.AUTHORITY });
- startActivity(intent); // the new activity won't be created until this.onStart() and this.onResume() are finished;
- }
-
-
- /**
- * Load of state dependent of the existence of an ownCloud account
- */
- private void initDataFromCurrentAccount() {
- /// Storage manager initialization - access to local database
- mStorageManager = new FileDataStorageManager(
- AccountUtils.getCurrentOwnCloudAccount(this),
- getContentResolver());
-
- /// Check if mCurrentDir is a directory
- if(mCurrentDir != null && !mCurrentDir.isDirectory()) {
- mCurrentFile = mCurrentDir;
- mCurrentDir = mStorageManager.getFileById(mCurrentDir.getParentId());
- }
-
- /// Check if mCurrentDir and mCurrentFile are in the current account, and update them
- if (mCurrentDir != null) {
- mCurrentDir = mStorageManager.getFileByPath(mCurrentDir.getRemotePath()); // mCurrentDir == null if it is not in the current account
- }
- if (mCurrentFile != null) {
- if (mCurrentFile.fileExists()) {
- mCurrentFile = mStorageManager.getFileByPath(mCurrentFile.getRemotePath()); // mCurrentFile == null if it is not in the current account
- } // else : keep mCurrentFile with the received value; this is currently the case of an upload in progress, when the user presses the status notification in a landscape tablet
- }
-
- /// Default to root if mCurrentDir was not found
- if (mCurrentDir == null) {
- mCurrentDir = mStorageManager.getFileByPath("/"); // will be NULL if the database was never synchronized
+ @Override
+ public void onConfigurationChanged (Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ if (mStarted) {
+ checkConfigurationChange(newConfig);
+ } else {
+ mNewConfigurationChangeToApplyOnStart = newConfig;