Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the second parameter in AddHeaderView in the class ListView do?

Below is the documentation of the method, I dont understand what does the Object data do?

What is it for?

public void addHeaderView (View v, Object data, boolean isSelectable)

Add a fixed view to appear at the top of the list. If addHeaderView is called more than once, the views will appear in the order they were added. Views added using this call can take focus if they want. NOTE: Call this before calling setAdapter. This is so ListView can wrap the supplied cursor with one that will also account for header and footer views.

Parameters:

   v:           The view to add.
   data:         Data to associate with this view.
   isSelectable: whether the item is selectable.
like image 452
Totic Avatar asked Nov 30 '10 08:11

Totic


1 Answers

It's the data returned from Adapter's getItem method.

like image 66
ognian Avatar answered Nov 01 '22 01:11

ognian