Nikita Shah
Nikita Shah

Reputation: 117

listview and keyboard navigation

What i have done :

In my application there is a Fragment Activity (The parent Activity) which launches a fragment and on that fragment there is button on click of which Another Activity launching which has custom listview.

Problem: When I navigate listview using keyboard it does not show highlighted state but, if i remove android:descendantFocusability="blocksDescendants" from listview it shows highlighted state but does not support onclick item of that listview.

Upvotes: 1

Views: 945

Answers (2)

Nikita Shah
Nikita Shah

Reputation: 117

Thank you guys I am done with the problem.The solution is to add one state in selector.xml i.e. 'android:state_activated="true"'

Upvotes: 1

Kaushik
Kaushik

Reputation: 6162

If there are focusable views in row.xml of your ListView add these attribute to each view

android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"

Upvotes: 1

Related Questions