I am developing a quiz application in which I am using runnable thread for seekbar functionality. seekbar shows how much time is remaining. Now I want to stop the seekbar when a answer button is click.
here is my code for runnable thread.
    new Thread(new Runnable() {
        public void run() {
             while (seekbarStatus < 100) {
                  seekbarStatus = LoadingStatus();
                  //  sleep 1 second to show the progress
                  try {
                          Thread.sleep(1000);
                      } 
                  catch (InterruptedException e) {
                          e.printStackTrace();
                      }
                  // Update the progress bar
                  progressBarHandler.post(new Runnable() {
                      public void run() {
                          seekbar.setProgress(seekbarStatus);
                      }
                  });
             }
             if (seekbarStatus >= 100) {
                 // sleep for  2 seconds, so that you can see the 100% of file download
                 runOnUiThread(new Runnable() {
                     @Override
                     public void run() {
                         if(!(Ans_1.getTag()=="clicked" ||Ans_2.getTag()=="clicked" || Ans_3.getTag()=="clicked" ))
                         {
                             Ans_1.setEnabled(false);
                             Ans_2.setEnabled(false);
                             Ans_3.setEnabled(false);
                             Ans_1.setBackgroundColor(Color.GREEN);
                             points.setText("0 Punkt");
                             new Handler().postDelayed(new Runnable(){
                                    @Override
                                    public void run() {
                                        /* Create an Intent that will start the Menu-Activity. */
                                        showDialogView();
                                    }
                                }, SPLASH_DISPLAY_LENGHT);
                         }
                    }
                    public void showDialogView() {
                        // TODO Auto-generated method stub
                        dialog.show();
                    }
                });
             }
         }
        }).start();
please help me. Any help would be appreciated.
I am not getting how to solve it.
Thanks in advance.
 
    