I have a text to speech application where the user can select a language and also select a male or female voice. The problem is that for each language there are different st
Sorry, I'm not able to comment on an answer yet, so I open a new one.
Instead of writing your own algorithm in order to find the index of a particular item in a String array just rely on the standard API (it's usually faster, better design and just shorter):
final int a = Arrays.binarySearch(languageAlias, languageData);
It's the same as :
int a = 0
for (a ; a < languageAlias.length ; a++) {
if (languageAlias[a].equals(languageData) {
break;
}
}