title: java.lang.NumberFormatException type casting in kotlin
body: <p>I want to do body mass index and it's pretty simple. but I could not do that. I get an error in type conversions, but I did not fix the problem. Hatam </p>
  
  <blockquote>
    <p>java.lang.NumberFormatException: Invalid int: "android.support.v7.widget.AppCompatTextView. </p>
  </blockquote>
  
  <p>I guess the </p>
  
  <pre><code>result = (kiloText.toString (). ToInt ()) / ((boy.toString (). ToInt () 
  boy.tostring (). toınt ())). todoubl a ()
  </code></pre>
  
  <p>  this code has type conversion error how can i do this?</p>
  
  <p>MainActivity.kt</p>
  
  <pre><code>class MainActivity : AppCompatActivity() {
  
  lateinit var kilo:SeekBar
  lateinit var boy: EditText
  lateinit var hesapla:Button
  lateinit var ideal: TextView
  lateinit var kiloText: TextView
  
  override fun onCreate(savedInstanceState: Bundle?) {
      super.onCreate(savedInstanceState)
      setContentView(R.layout.activity_main)
  
      kilo=findViewById(R.id.seekbar)
      boy=findViewById(R.id.edt_boy)
      hesapla=findViewById(R.id.hesapla)
      ideal=findViewById(R.id.ideal)
      kiloText=findViewById(R.id.kilo)
  
      kilo.max=150
      kilo.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
          override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
              kiloText.text=p1.toString()
          }
  
          override fun onStartTrackingTouch(p0: SeekBar) {
              kiloText.text= p0.progress.toString()
          }
  
          override fun onStopTrackingTouch(p0: SeekBar) {
              kiloText.text=p0.progress.toString()
          }
  
      })
  
      hesapla.setOnClickListener({
          var sonuc:Double
          sonuc=(kiloText.toString().toInt())/((boy.toString().toInt())*(boy.toString().toInt())).toDouble()
        ideal.text=sonuc.toString()
  
  
      })
  
  }
   }
  </code></pre>