Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8288013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:11:22+00:00 2026-06-08T12:11:22+00:00

My app has Buttons and when you press the Buttons they use text to

  • 0

My app has Buttons and when you press the Buttons they use text to speech to say something.

My Buttons work fine, but when I set up the id.talk Button and gave it the speech command it didn’t do anything. When I click on it nothing happens.

public void onClick(View v) {
    switch (v.getId()) {

    // use switch case so each button does a different thing
    // accurately(similar to an if statement)
    case R.id.btn_speak:
        String words1 = speakButton.getText().toString();

        // speakwords(xxxx); is the piece of code that actually calls the
        // text to speech
        speakWords(words1);
        Intent voiceIntent = new Intent(
                "android.intent.action.RECOGNITIONMENU");
        startActivity(voiceIntent);
        break;
    case R.id.aboutbutton:
        String words2 = infoButton.getText().toString();
        speakWords(words2);
        Intent infoIntent = new Intent("android.intent.action.INFOSCREEN");
        startActivity(infoIntent);
        break;
    case R.id.voicebutton:
        speakWords("Speak Now");
        startVoiceRecognitionActivity(); // call for voice recognition
                                            // activity
        break;
    case R.id.talk:
        speakWords("This is the main menu.");
        break;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:11:23+00:00Added an answer on June 8, 2026 at 12:11 pm
    btn =(Button) findViewById(R.id.talk);
                                    ^^^^
    
    btn.setOnClickListener(this);<---
    

    have you added listener to your new button ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm making an android app that has more than 100 buttons,but you know
I have an iPhone app that use UIPickerView and 3 buttons. This picker has
My app has several buttons which trigger different events. The user should NOT be
My swing app has a main window which has sever buttons. This JFrame is
I'm writing a Rails app which has the following jasmine spec: describe buttons, ->
I have a winforms app and the main (and only) form has several buttons.
I have an view in my App which has a number of buttons based
The problem is after i press 2 buttons the App crashes and I can't
I have very unique problem. My app has UINavigationCnotroller with a set of UIViewController's.
I'm making an app and it has multiple button that when you press them

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.