]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryManagerActivity.java
More thorough writability check.
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryManagerActivity.java
index 127de4358792396ba289327b3673ae7d793d1611..f22f7d4cb800f06cded32416733bbc4a0c220707 100644 (file)
@@ -174,8 +174,9 @@ public class DictionaryManagerActivity extends ActionBarActivity {
                             Toast.LENGTH_LONG).show();
                 } catch (Exception e) {
                     String msg = getString(R.string.unzippingFailed, dest);
-                    if (!application.getDictDir().canWrite()) {
-                        msg = getString(R.string.notWritable, application.getDictDir().getAbsolutePath());
+                    File dir = application.getDictDir();
+                    if (!dir.canWrite() || !application.checkFileCreate(dir)) {
+                        msg = getString(R.string.notWritable, dir.getAbsolutePath());
                     }
                     new AlertDialog.Builder(context).setTitle(getString(R.string.error)).setMessage(msg).setNeutralButton("Close", null).show();
                     Log.e(LOG, "Failed to unzip.", e);