I have a view in my app which contains a ListView. Sometimes a row in the list is highlighted when the activity starts or resumes and if I hit the Enter key (on the physical keyboard of my device) then it does a click on the row.
I tried to override the OnKeyListener of the main view or of the list or to set it to null but it didn’t change anything.
How can I achieve this ?
EDIT : sorry if it wasn’t clear.
I want the ListView to react on clicks but only if I touch the screen, not when I push the enter key. And I don’t want the list to react to the physical arrow keys. Basically a row should be focused or clicked in any other way than touching the screen.
It’s not 100% right but since my view only had a ListView the following code did what I wanted :