title: Check if EditText is empty kotlin android
body: <p>How do you check if an EditText is empty? input type number</p>
  
  <p><img src="https://i.stack.imgur.com/oowyj.png" alt=""></p>
  
  <pre><code>package com.example.www.myapplication
  
  import android.support.v7.app.AppCompatActivity
  import android.os.Bundle
  import kotlinx.android.synthetic.main.activity_main.*
  import java.util.*
  
  class MainActivity : AppCompatActivity() {
  
  override fun onCreate(savedInstanceState: Bundle?) {
      super.onCreate(savedInstanceState)
      setContentView(R.layout.activity_main)
      button.setOnClickListener {
  
          val inter:Int=editText.text.toString().toInt()
          val year: Int = Calendar.getInstance().get(Calendar.YEAR)
          val res:Int=year-inter
          textView.text=res.toString()
      }
  }
  </code></pre>