diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-27 15:18:06 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-30 09:23:54 +0200 |
commit | a518d5a4a7de70426ddb4dbcfdb5c7859aa2f225 (patch) | |
tree | 15182a9f0112f166e9c036ed80c5aa2744e5984d /android | |
parent | 54510b3b65141bebb342fea9ffe9f59e7b2d9bbf (diff) |
android: open csv files in Calc
Change-Id: I17b9c4f9d40db46fe6f1be8f1a3ecaee4946454c
Diffstat (limited to 'android')
-rw-r--r-- | android/experimental/LOAndroid3/AndroidManifest.xml.in | 1 | ||||
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/android/experimental/LOAndroid3/AndroidManifest.xml.in b/android/experimental/LOAndroid3/AndroidManifest.xml.in index e151172fd17d..040246da1bf8 100644 --- a/android/experimental/LOAndroid3/AndroidManifest.xml.in +++ b/android/experimental/LOAndroid3/AndroidManifest.xml.in @@ -77,6 +77,7 @@ <!-- OTHER --> <data android:mimeType="text/csv"/> + <data android:mimeType="text/comma-separated-values"/> <data android:mimeType="application/vnd.ms-works" /> <data android:mimeType="application/vnd.apple.keynote" /> <data android:mimeType="application/x-abiword" /> diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java index c054143bcad0..c169d8e619a4 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java @@ -171,7 +171,14 @@ public class LibreOfficeMainActivity extends ActionBarActivity { InputStream inputStream = null; try { inputStream = contentResolver.openInputStream(getIntent().getData()); - mTempFile = File.createTempFile("LibreOffice", null, this.getCacheDir()); + + // CSV files need a .csv suffix to be opened in Calc. + String suffix = null; + String intentType = getIntent().getType(); + // K-9 mail uses the first, GMail uses the second variant. + if ("text/comma-separated-values".equals(intentType) || "text/csv".equals(intentType)) + suffix = ".csv"; + mTempFile = File.createTempFile("LibreOffice", suffix, this.getCacheDir()); OutputStream outputStream = new FileOutputStream(mTempFile); byte[] buffer = new byte[4096]; |