]> gitweb.fperrin.net Git - Dictionary.git/commitdiff
Add fallback to old code, needed on some devices.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Wed, 16 Dec 2015 20:05:46 +0000 (21:05 +0100)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Wed, 16 Dec 2015 20:05:46 +0000 (21:05 +0100)
src/com/hughes/android/dictionary/DictionaryManagerActivity.java

index 6c701cea0ddd4babbb7d9ad5717b1e20eef80bd8..159a7f0abf5037a9516e65e6bf4536c8ee4411f0 100644 (file)
@@ -637,7 +637,12 @@ public class DictionaryManagerActivity extends ActionBarActivity {
                     .getName();
             Log.d(LOG, "Downloading to: " + destFile);
 
-            request.setDestinationInExternalFilesDir(getApplicationContext(), null, destFile);
+            try {
+                request.setDestinationInExternalFilesDir(getApplicationContext(), null, destFile);
+            } catch (IllegalStateException e) {
+                request.setDestinationUri(Uri.fromFile(new File(Environment
+                        .getExternalStorageDirectory(), destFile)));
+            }
         } catch (MalformedURLException e) {
             throw new RuntimeException(e);
         }