}
dictRaf = null;
}
- Toast.makeText(this, getString(R.string.invalidDictionary, "", e.getMessage()),
- Toast.LENGTH_LONG).show();
+ if (!isFinishing())
+ Toast.makeText(this, getString(R.string.invalidDictionary, "", e.getMessage()),
+ Toast.LENGTH_LONG).show();
startActivity(DictionaryManagerActivity.getLaunchIntent(getApplicationContext()));
finish();
}
}
if (dictFilename == null) {
- Toast.makeText(this, getString(R.string.no_dict_file), Toast.LENGTH_LONG).show();
+ if (!isFinishing())
+ Toast.makeText(this, getString(R.string.no_dict_file), Toast.LENGTH_LONG).show();
startActivity(DictionaryManagerActivity.getLaunchIntent(getApplicationContext()));
finish();
return;
typeface = Typeface.createFromAsset(getAssets(), fontName);
} catch (Exception e) {
Log.w(LOG, "Exception trying to use typeface, using default.", e);
- Toast.makeText(this, getString(R.string.fontFailure, e.getLocalizedMessage()),
- Toast.LENGTH_LONG).show();
+ if (!isFinishing())
+ Toast.makeText(this, getString(R.string.fontFailure, e.getLocalizedMessage()),
+ Toast.LENGTH_LONG).show();
}
break;
}
out.close();
} catch (Exception e) {
Log.e(LOG, "Unable to append to " + wordList.getAbsolutePath(), e);
- Toast.makeText(this,
- getString(R.string.failedAddingToWordList, wordList.getAbsolutePath()),
- Toast.LENGTH_LONG).show();
+ if (!isFinishing())
+ Toast.makeText(this,
+ getString(R.string.failedAddingToWordList, wordList.getAbsolutePath()),
+ Toast.LENGTH_LONG).show();
}
}