From e426fbc423c46beecbb34ed45d69b76208fde354 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Reimar=20D=C3=B6ffinger?= Date: Wed, 16 Dec 2015 21:05:46 +0100 Subject: [PATCH] Add fallback to old code, needed on some devices. --- .../android/dictionary/DictionaryManagerActivity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/hughes/android/dictionary/DictionaryManagerActivity.java b/src/com/hughes/android/dictionary/DictionaryManagerActivity.java index 6c701ce..159a7f0 100644 --- a/src/com/hughes/android/dictionary/DictionaryManagerActivity.java +++ b/src/com/hughes/android/dictionary/DictionaryManagerActivity.java @@ -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); } -- 2.43.0