From e5163561233aeef61af4a4fe8085dbb0c714f609 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 15 Sep 2013 15:56:46 +0100 Subject: [PATCH] DownloadVoiceData.java: Inline onLanguagesInstalled to the onPostExecute callback. --- .../reecedunn/espeak/DownloadVoiceData.java | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/android/src/com/reecedunn/espeak/DownloadVoiceData.java b/android/src/com/reecedunn/espeak/DownloadVoiceData.java index 04bfe7e7..e1060ba5 100755 --- a/android/src/com/reecedunn/espeak/DownloadVoiceData.java +++ b/android/src/com/reecedunn/espeak/DownloadVoiceData.java @@ -49,7 +49,18 @@ public class DownloadVoiceData extends Activity { mAsyncExtract = new AsyncExtract(this, R.raw.espeakdata, dataPath) { @Override protected void onPostExecute(Integer result) { - onLanguagesInstalled(result); + switch (result) { + case RESULT_OK: + final Intent intent = new Intent(BROADCAST_LANGUAGES_UPDATED); + sendBroadcast(intent); + break; + case RESULT_CANCELED: + // Do nothing? + break; + } + + setResult(result); + finish(); } }; @@ -67,21 +78,6 @@ public class DownloadVoiceData extends Activity { mAsyncExtract.cancel(true); } - private void onLanguagesInstalled(int resultCode) { - switch (resultCode) { - case RESULT_OK: - final Intent intent = new Intent(BROADCAST_LANGUAGES_UPDATED); - sendBroadcast(intent); - break; - case RESULT_CANCELED: - // Do nothing? - break; - } - - setResult(resultCode); - finish(); - } - private static void clearContents(File directory) { if (!directory.exists() || !directory.isDirectory()) { return;