DownloadVoiceData.java: Inline onLanguagesInstalled to the onPostExecute callback.

This commit is contained in:
Reece H. Dunn
2013-09-15 15:56:46 +01:00
parent bd2d3803cc
commit e516356123
@@ -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;