/* Called when the activity is first created */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mode = (RadioGroup) findViewById(R.id.playjokes); mode.setOnCheckedChangeListener(this); }
@Override protected void onLoaded() { super.onLoaded(); this.speak( "Welcom to LOL," + "At any point as long as I am not speaking, you can say home to go back to this menu," + "To play random jokes, say random," + "To select category, say category,"); }
@Override protected void onSpeechToTextEvent(String recognizedWord) { if (recognizedWord.equals("random")) { Intent optionselected_rand = new Intent(MainActivity.this, JokeActivity.class); startActivity(optionselected_rand); } else if (recognizedWord.equals("category")) { Intent optionselected_cat = new Intent(MainActivity.this, CategoryActivity.class); startActivity(optionselected_cat); } super.onSpeechToTextEvent(recognizedWord); }