How can I eliminate the dependency from of a ListView's onItemClick/getView and its row types?
问题 As a simplified example, consider a ListView that can contain both sub-categories and book titles. If a book title is clicked, a new activity should start that shows the cover image. If a sub-category is clicked, a new list of books and categories is displayed. A Row interface is defined as follows. interface Row { void onClick(); void draw(View v); } I would like to know how to prevent a dependency from the ListView 's ArrayAdapter as well as from the implementer of onItemClickListener on