Question

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.
Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top