package com.owncloud.android.ui.activity;
import java.io.File;
-import java.io.IOException;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AuthenticatorException;
-import android.accounts.OperationCanceledException;
-import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.AlertDialog;
import android.app.Dialog;
actionBar.setDisplayShowTitleEnabled(!noRoot);
if (!noRoot) {
actionBar.setTitle(getString(R.string.default_display_name_for_root_folder));
- getWindow().getDecorView().findViewById(actionBarTitleId).setContentDescription(getString(R.string.default_display_name_for_root_folder));
+ View actionBarTitleView = getWindow().getDecorView().findViewById(actionBarTitleId);
+ if (actionBarTitleView != null) { // it's null in Android 2.x
+ actionBarTitleView.setContentDescription(getString(R.string.default_display_name_for_root_folder));
+ }
}
actionBar.setNavigationMode(!noRoot ? ActionBar.NAVIGATION_MODE_STANDARD : ActionBar.NAVIGATION_MODE_LIST);
actionBar.setListNavigationCallbacks(mDirectories, this); // assuming mDirectories is updated
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setTitle(chosenFile.getFileName());
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
- getWindow().getDecorView().findViewById(actionBarTitleId).setContentDescription(chosenFile.getFileName());
+ View actionBarTitleView = getWindow().getDecorView().findViewById(actionBarTitleId);
+ if (actionBarTitleView != null) { // it's null in Android 2.x
+ getWindow().getDecorView().findViewById(actionBarTitleId).
+ setContentDescription(chosenFile.getFileName());
+ }
}
}
if (file.isFolder()) {
return file;
} else if (getStorageManager() != null) {
- String parentPath = file.getRemotePath().substring(0, file.getRemotePath().lastIndexOf(file.getFileName()));
+ String parentPath = file.getRemotePath().substring(0,
+ file.getRemotePath().lastIndexOf(file.getFileName()));
return getStorageManager().getFileByPath(parentPath);
}
}
getAccount(),
getApplicationContext()
);
- synchFolderOp.execute(getAccount(), this, null, null);
+ synchFolderOp.execute(getAccount(), MainApp.getAppContext(), this, null, null);
setSupportProgressBarIndeterminateVisibility(true);
*/
public void showUntrustedCertDialog(RemoteOperationResult result) {
// Show a dialog with the certificate info
- SslUntrustedCertDialog dialog = SslUntrustedCertDialog.newInstanceForFullSslError((CertificateCombinedException)result.getException());
+ SslUntrustedCertDialog dialog = SslUntrustedCertDialog.newInstanceForFullSslError(
+ (CertificateCombinedException)result.getException());
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
dialog.show(ft, DIALOG_UNTRUSTED_CERT);