From: Reimar Döffinger Date: Wed, 16 Dec 2015 20:05:46 +0000 (+0100) Subject: Add fallback to old code, needed on some devices. X-Git-Url: http://gitweb.fperrin.net/?p=Dictionary.git;a=commitdiff_plain;h=e426fbc423c46beecbb34ed45d69b76208fde354 Add fallback to old code, needed on some devices. --- 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); }