-->\r
<manifest package="eu.alefzero.owncloud"\r
android:versionCode="1"\r
- android:versionName="0.1.147B" xmlns:android="http://schemas.android.com/apk/res/android">\r
+ android:versionName="0.1.148B" xmlns:android="http://schemas.android.com/apk/res/android">\r
\r
<uses-permission android:name="android.permission.GET_ACCOUNTS" />\r
<uses-permission android:name="android.permission.USE_CREDENTIALS" />\r
Intent upload_intent = new Intent(context, InstantUploadService.class);
Account account = new Account(account_name, AccountAuthenticator.ACCOUNT_TYPE);
- String mimeType;
+ String mimeType = null;
try {
mimeType = MimeTypeMap.getSingleton()
.getMimeTypeFromExtension(
} catch (IndexOutOfBoundsException e) {
Log.e(TAG, "Trying to find out MIME type of a file without extension: " + f.getName());
- mimeType = "application/octet-stream";
}
+ if (mimeType == null)
+ mimeType = "application/octet-stream";
upload_intent.putExtra(InstantUploadService.KEY_ACCOUNT, account);
upload_intent.putExtra(InstantUploadService.KEY_FILE_PATH, file_path);
for (int i = 0; i < mLocalPaths.length; ++i) {
- String mimeType;
+ String mimeType = null;
try {
mimeType = MimeTypeMap.getSingleton()
.getMimeTypeFromExtension(
.lastIndexOf('.') + 1));
} catch (IndexOutOfBoundsException e) {
Log.e(TAG, "Trying to find out MIME type of a file without extension: " + mLocalPaths[i]);
- mimeType = "application/octet-stream";
}
+ if (mimeType == null)
+ mimeType = "application/octet-stream";
mCurrentIndexUpload = i;
if (wc.putFile(mLocalPaths[i], mRemotePaths[i], mimeType)) {
try {\r
Intent i = new Intent(Intent.ACTION_VIEW);\r
mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(storagePath.substring(storagePath.lastIndexOf('.') + 1));\r
- if (mimeType != mFile.getMimetype()) {\r
+ if (mimeType != null && !mimeType.equals(mFile.getMimetype())) {\r
i.setDataAndType(Uri.parse("file://"+mFile.getStoragePath()), mimeType);\r
i.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\r
startActivity(i);\r