Just in case it fixes the rare random crashes.
- 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();
}
startActivity(DictionaryManagerActivity.getLaunchIntent(getApplicationContext()));
finish();
}
}
if (dictFilename == null) {
}
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;
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);
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();
out.close();
} catch (Exception e) {
Log.e(LOG, "Unable to append to " + wordList.getAbsolutePath(), e);
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();