mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
DownloadVoiceData.java: Inline onLanguagesInstalled to the onPostExecute callback.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user