Ejemplo n.º 1
0
  /* 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);
  }
Ejemplo n.º 2
0
 @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,");
 }
Ejemplo n.º 3
0
  @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);
  }