ITM 707 Lecture 11: Lab05
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)