ITM 707 Lecture 11: Lab05

46 views1 pages

Document Summary

Lab 05: clickable listview item create a new project. Create a listview object and set its id: listview. Create a listview variable and refer to onscreen listview. Arraylist name =new arraylist<>(); add items in the by using. Add your name and five other friends names. Create an arrayadapter arrayadapter = new arrayadapter(this, android. r. layout. simple_list_item_1, arraylistname); Then add the adapter to the listview listview. setadapter(arrayadapter); Run the program, should see list of items. Add clickability on the items add the setonitemclicklistener (new adapterview. onitemclicklistener() -> { public void onitemclick(adapterview> adapterview, view view, int i, long l){ Take another screen shot after you clicked on an item (should show message)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents