Back to project page android-unispeech.
The source code is released under:
Apache License
If you think the Android project android-unispeech listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.github.unispeech.languageselect; //from ww w . ja v a2 s. c o m import android.content.Context; import android.content.Intent; import android.os.Bundle; import com.github.unispeech.recognition.RecognitionActivity; /** * Created by javier.romero on 2/6/14. */ public class TheirLanguageSelectActivity extends BaseLanguageSelectActivity { private static final String EXTRA_YOUR_LANGUAGE = "EXTRA_YOUR_LANGUAGE"; private SupportedSttLanguage mYourLanguage; public static Intent newIntent(Context context, SupportedSttLanguage yourLanguage) { Intent intent = new Intent(context, TheirLanguageSelectActivity.class); intent.putExtra(EXTRA_YOUR_LANGUAGE, yourLanguage.getIsoCode()); return intent; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); readBundle(savedInstanceState); } private void readBundle(Bundle savedInstanceState) { String isoCode = null; if (savedInstanceState != null) { isoCode = savedInstanceState.getString(EXTRA_YOUR_LANGUAGE); } else { if (getIntent() != null && getIntent().getExtras() != null) { isoCode = getIntent().getExtras().getString(EXTRA_YOUR_LANGUAGE); } } if (isoCode == null) { throw new IllegalStateException("No 'EXTRA_YOUR_LANGUAGE' passed!"); } mYourLanguage = SupportedSttLanguage.fromIsoCode(isoCode); } @Override protected String getPrompt() { return "They speak..."; } @Override protected void onLanguageClicked(SupportedSttLanguage language) { Intent intent = RecognitionActivity.newIntent(this, mYourLanguage, language); startActivity(intent); } }