Stack Overflow archive
1 score

Listview onClickListener is not working in Drawer Layout

score
1
question views
2.7K
license
CC BY-SA 3.0

In your RelativeLayout set android:clickable="true". Or, a better approach would be to set an OnItemClickListener on your ListView.

java
yourListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        // TODO: do your stuff
    }
});

Originally posted on Stack Overflow. Public user contributions are licensed under Creative Commons Attribution-ShareAlike.