Android ListView OnItemClickListner Vs. View OnClickListener

Why doesn't the OnClickListener for the view inside the ListView respond to the trackball by clicking on the view, while the OnItemClickListener for the ListView responds to the trackball by clicking on one of the ListViews?

+4
source share
1 answer

This is by design.

The ListView component is specifically designed to trigger these events this way. I believe that they are actually defined in the AdapterView abstract class. Other AdapterView descendants ( Gallery , Spinner , etc.) will also behave the same.

There is also ONItemLongClick .

View.OnClick used only by controls with simple semantics, for example. Button , where there is only one click view.

0
source

All Articles