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 6139017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:56:13+00:00 2026-05-23T17:56:13+00:00

in my app when user clicks on a spell button then it play audio

  • 0

in my app when user clicks on a spell button then it play audio to read outs letters of a word with displaying each letters. It is implemented successfully!.

And i used swipe gesture to change the word. if user swipes the screen then another word should be displayed. and It also implemented successfully!!

Problem:
While audio is playing if user swipes then the audio should stop and next word shold be displayed.(I guess the running thread should be stopped).

How can i do that? Any Solution?

Code Outlines:

public class BirdsActivity extends Activity implements OnClickListener{

//On createMethod*(){
.
.
  //on Spell button click run a thread to play audio and draw text
    new DrawLetter("AlphaKids").start();

// initiate Gesture detection

  }


class DrawLetter extends Thread {
    String tempName=names[position];    
    String b="";
    int i=0;
    public DrawLetter(String str) {
    super(str);
    }
    public void run() {

        for (int i = 0; i < names[position].length(); i++) {
     runOnUiThread(new Runnable()
                {               
                     public void run() 
                  {     txtFrontName.setText(b); }

                });

            mPlayVoice = MediaPlayer.create(BirdsActivity.this, mAlphabetsSound[letterPosition]);
                mPlayVoice.start();
                try {
            sleep(500); 
            mPlayVoice.release();
            } catch (InterruptedException e) {}
     }}
.
.
.
  // Gesture detection class

@Override
    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {

      //if  valid swipe is performed
      {  
            //i want to stop(or Distroy) the above thread here

     }
} }
  • 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-05-23T17:56:14+00:00Added an answer on May 23, 2026 at 5:56 pm

    I guess you don’t have to destroy the thread your self. Stop the music mPlayVoice.stop(); since the variable is declared in UIThread … it can be accessed in UIThread and you can stop your player from there. most probably in handler.

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

Sidebar

Related Questions

In my typical app, the user clicks a button in an aspx page, invokes
I have an app in which the user clicks a button, triggering an iFrame
I have an AJAX app. A user clicks a button, and the page's display
I'm creating an Android app, when a user clicks a button in the app
My app pulls up a uitableview screen when the user clicks a settings button.
I am displaying a confirm box in my app. When the user clicks on
When a user clicks the SHow me more button in my app, I want
in my ios app when the user clicks a button it opens email part
in my app i have a button named Search, When the user clicks the
in my app when the user clicks a button, it hits an url and

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.