title: Future task doesn't work properly(Android)
body: <p>I want to make a 'seeking' text which will be like:
  "Loading ." -> "Loading .."-> "Loading ..."</p>
  
  <p>and then once I get certain data , stop this animation text and just set the text as "Found."</p>
  
  <p>I tried implementing it that way :</p>
  
  <pre><code>ExecutorService threadPoolExecutor = Executors.newSingleThreadExecutor();
  Future textAnimationTaskFuture;
  Runnable textAnimationTask;
  
  textAnimationTask = new Runnable() {
              @Override
              public void run() {
                  int passedTime = 0;
                  while(passedTime &lt; 3000)
                  {
                      if(passedTime &lt; 1000){         
                         textView.setText("Loading.");
                      }
                      else if(passedTime &gt;= 1000 &amp;&amp; passedTime &lt; 2000 )
                      {
                         textView.setText("Loading..");
                      }else if (passedTime &gt;= 3000)
                      {
                         textView.setText("Loading...");
                      }
                      passedTime = passedTime + 1;
                      if( passedTime == 3000 )
                          passedTime = 0;
                  }
              }
          };
  </code></pre>
  
  <p>And then I would run the process :</p>
  
  <pre><code> textAnimationTaskFuture = threadPoolExecutor.submit(textAnimationTask);
  </code></pre>
  
  <p>And cancel it :</p>
  
  <pre><code> textAnimationTaskFuture.cancel(true);
   textView.setText("Found.);
  </code></pre>
  
  <p>Unfortunately the loop doesn't stop on cancel(true).</p>