listview - setOnLongClickListener in kotlin android -


how can use setonclicklistener in each item in listview?

my xml :

<listview     android:id="@+id/tv1"     android:layout_width="match_parent"     android:layout_height="wrap_content">  </listview> 

in kotlin activity:

override fun oncreate(savedinstancestate: bundle?) {   val listview: listview = findviewbyid(r.id.yourlistviewid)   listview.onitemclicklistener = adapterview.onitemclicklistener { adapterview, view, i, l ->      //your code here   } } 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -