title: Toast when no item is selected in listView
body: <p>Hi guys I´m trying to make this work:</p>
  
  <pre><code>         button.setOnClickListener {
              if (list1.choiceMode == android.widget.ListView.CHOICE_MODE_NONE){
                  toast("You need to choose an item first")
              }
              else {
                  val builder = AlertDialog.Builder(this)
                  builder.setTitle("Alert")
                  builder.setMessage("This service requires data?")
                  builder.setPositiveButton("Yes", { dialogInterface: DialogInterface, i: Int -&gt;
                      ListView.visibility = View.GONE
                      website.visibility = View.VISIBLE
                  })
                  builder.setNegativeButton("No", { dialogInterface: DialogInterface, i: Int -&gt; })
                  builder.show()
              }
  
          }
  </code></pre>
  
  <p>I´m trying to display a message when the user press the button but he hasn´t selected any item from the list1. And if everything is ok, I want it to get the listView visibility set to gone and  the website visibility set to visible.</p>
  
  <p>All i get when pressing the button is the toast message.</p>
  
  <p>EDITED:</p>
  
  <pre><code>    val nameofanimals = arrayOf("cat","dog","parrot")
  
  internal lateinit var adapteranimals: ArrayAdapter&lt;String&gt;
  </code></pre>
  
  <p>here is my list:</p>
  
  <pre><code>val list1 = findViewById(R.id.list1) as ListView
  
  
      &lt;ListView
          android:id="@+id/list1"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="1"
          android:choiceMode="singleChoice"
          android:focusable="true"
          android:focusableInTouchMode="true"
          android:listSelector="@android:color/darker_gray"
          android:textSize="10dp"
          android:visibility="gone"&gt;
  
  
      &lt;/ListView&gt;
  </code></pre>
  
  <p>my adapter:</p>
  
  <pre><code>adapteranimals = ArrayAdapter(
          this@MainActivity,
          R.layout.list1layout,
          nameofanimals)
  list1.adapter = adapteranimals
  </code></pre>
  
  <p>Now I need to display a toast message when none of cat, dog or parrot is selected, and want to set the visibility of a webviewer and a listview layout to visible and to gone when the user actually select one of the options in my list</p>