arnp
arnp

Reputation: 3208

How to get ListItem height of a listview (CustomAdapter used)?

I am using custom adapter for a listview and i need to get the listitem height for displaying the listview in a scrollview. I tried to do that in a normal listview with simple adapter. I am able to get the adapter using [listView.getAdapter()] but in case of customadapter unable to get the adapter or height of the listitem. How can i make it possible. And also unable to have listitem click.

This is my reffered link for listview in scrollview: Click here

The code of the adapter i have used is:

CustomAdapter-Code

Upvotes: 0

Views: 991

Answers (1)

April Smith
April Smith

Reputation: 1830

Because [Null pointer exception]

I guess change here,

int height = convertView.getHeight(); >> int height = vi.getHeight();

p.s. just guess, sorry for my bad if it doesn't help

Upvotes: 1

Related Questions