<string name="unzippingDictionary">Unzipping dictionary: \n%s</string>
<string name="unzippingFailed">Unzipping failed: \n%s</string>
<string name="installationFinished">Installation finished: \n%s.</string>
+ <string name="notWritable">Dictionary location %s not writable, change in settings.</string>
<!-- DictionaryActivity -->
<string name="searchText">Search Text</string>
<string name="themeKey">theme</string>
<string name="themeTitle">UI theme</string>
<string name="themeSummary">User-interface color theme.</string>
+ <string name="chosenNotWritable">Chosen directory not writable, try one of</string>
</resources>
Toast.makeText(context, getString(R.string.installationFinished, dest),
Toast.LENGTH_LONG).show();
} catch (Exception e) {
- new AlertDialog.Builder(context).setTitle(getString(R.string.error)).setMessage(getString(R.string.unzippingFailed, dest)).setNeutralButton("Close", null).show();
+ String msg = getString(R.string.unzippingFailed, dest);
+ if (!application.getDictDir().canWrite()) {
+ msg = getString(R.string.notWritable, application.getDictDir().getAbsolutePath());
+ }
+ new AlertDialog.Builder(context).setTitle(getString(R.string.error)).setMessage(msg).setNeutralButton("Close", null).show();
Log.e(LOG, "Failed to unzip.", e);
} finally {
localZipFile.delete();
defaultDic.setEntries(entries);
defaultDic.setEntryValues(entryvalues);
+ }
+ @Override
+ protected void onPause() {
+ super.onPause();
+ final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
+ prefs.unregisterOnSharedPreferenceChangeListener(this);
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.registerOnSharedPreferenceChangeListener(this);
}
dirs += "\n" + externalFilesDir;
}
new AlertDialog.Builder(this).setTitle(getString(R.string.error))
- .setMessage("Chosen directory not writeable, try one of" + dirs)
+ .setMessage(getString(R.string.chosenNotWritable) + dirs)
.setNeutralButton("Close", null).show();
}
}