title: Android for loop not working in main thread
body: <p>i try to rotate image. i used runnable to rotate image,i wrote for loop and i want to rotate image inside for loop
  this is a my source</p>
  
  <pre><code>public void rotateimages(final View myView) {
      myHandler = new Handler();
      runnable = new Runnable() {
  
          @Override
          public void run() {
  
              double k = 30;
  
              double speed = Math.PI / k;
              for (alpa = 0; alpa &lt; (Math.PI * 6 + res * 2 * Math.PI / 5); alpa += speed) {
  
                  myView.setRotation((float) (myView.getRotation() - alpa));
  
                  Log.e("alpa values", String.valueOf(alpa));
  
                  k = Math.min(k + 0.2, 240);
                  speed = Math.PI / k;
                  myHandler.postDelayed(this, 100); 
              }
              // rotateimages();
          }
  
      };
  
      myHandler.postDelayed(runnable, 180);
  }
  </code></pre>
  
  <p>when i run my app i can rotate only one time.what is a wrong in my code? if anyone knows solution please help me</p>