title: Kotlin: Android Studio - Print on Emulator not the same as print using Log.v(TAG
body: <pre><code>fun division(){
      val numerator = 1000   
      var denominator = 4
      var index = 1
      val outputText = (&quot;Result is ${numerator / denominator}&quot;)
      val indexText: TextView = findViewById(Rid.index_textview)
      val divisionText: TextView = findViewById(R.id.division_textView)
  
      repeat(3){                                  //repeats block three times
          Log.v(TAG, &quot;${numerator / denominator}&quot;)//logs output to Logcat
          divisionText.text= outputText           //outputs the calculation text to emulator
          indexText.text = (&quot;Index is $index&quot;)    //outputs the index value text to emulator
          Thread.sleep(1000)//milliseconds        //pauses 1 second between repeats
          denominator--                           //decrements denominator by 1
          index++                                 //increments index by 1
      }
  }   
  </code></pre>
  <p>When the code (incomplete here) is run in Android Studio on the emulator, I get one line of text for each indexText and divisionText, instead of three expected.  Additionally,the output for divisionText is 250 and the indexText is 3.  The Android Studio logcat outputs each division calculation correctly. When I run the code in Kotlin playground, the code gives me three lines each of indexText and divisionText.  However, the indexText value is output correctly, incrementing one more each repeat cycle, while the calculation of numerator / denominator only outputs the 'same' final calculation on each repeated line cycle.</p>