Getting id of imageview
问题 I am making a number of imageViews programmatically in a loop and assigning them ids. But when in onClick method I need to get the id of images, it is returning the id of the last image only. How do I get the id of the image that is clicked? The code I am using: for (int j = 0; j < 5; j++) { TableRow tr = new TableRow(this); imageUrl = "http://ondamove.it/English/images/users/"; imageUrl = imageUrl + listObject.get(j).getImage(); image = new ImageView(this); image.setPadding(20, 10, 0, 0);