Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. package com.apppppp.trylistview
  2.  
  3. import android.support.v7.app.AppCompatActivity
  4. import android.os.Bundle
  5. import android.widget.ListView
  6.  
  7. class MainActivity : AppCompatActivity() {
  8.  
  9. override fun onCreate(savedInstanceState: Bundle?) {
  10. super.onCreate(savedInstanceState)
  11. setContentView(R.layout.activity_main)
  12.  
  13.  
  14. val list = findViewById<ListView>(R.id.clockList)
  15. val adapter = TimeZoneAdapter(this)
  16.  
  17. list.adapter = adapter
  18.  
  19. list.setOnItemClickListener { _, _, position, _ ->
  20.  
  21. val timeZone = adapter.getItem(position)
  22. println(timeZone)
  23. }
  24.  
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement