title: Show Dialog After Thread is Finish
body: <p>I want show dialog after finish Thread.
  In thread I am changing TextView's Value like as 0 to 100...
  When TextView Value is reach 100 then i want to show dialog..</p>
  
  <p>What i do for it.
  Thanks in advance...
  Code Snippet:</p>
  
  <pre><code> final Thread thread = new Thread(new Runnable() 
   {
              @Override
              public void run() 
              {
                  synchronized (this) 
                  {
                      try 
                      {
                          for(int i=0 ; i&lt;speed; i++)
                         {
                              final int value=i+1;
                              wait(3000/speed);      
                              Test.this.runOnUiThread(new Runnable() {@Override public void run()
                              {
                                  accText.setText(String.valueOf(value));
                              }});
  
                          }
  
                      }
                     catch (InterruptedException e)
                     {
                      // TODO Auto-generated catch block
                         e.printStackTrace();
                     }
                 }
  
              }
          });
         thread.start();
  </code></pre>
  
  <p>this is asyntask code snippet...</p>
  
  <pre><code>   class setTextBackgroundTask extends AsyncTask&lt;String , Integer, Void&gt;
  {
      @Override
      protected void onPreExecute()
      {
  
      } 
      @Override
      protected Void doInBackground(String... params) 
      {
          Thread th = new Thread();
          int value;
          for(int i=0 ; i&lt;speed; i++)
         {
              value=i+1;
              publishProgress(value);
              try {
                  th.sleep(3000/speed);
              } catch (InterruptedException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
  
          }
  
          return null;
      }
      @Override
      protected void onProgressUpdate(Integer... values)
      {
          accText.setText(String.valueOf(values[0]));
          System.out.println("Value=="+values[0]);
  
          super.onProgressUpdate(values);
      }
      @Override
      protected void onPostExecute(Void result) 
      {
  
                 showShareDialog();
  
      }
  
  
  }
  </code></pre>