A concrete BaseAdapter that is backed by concatenated DataBuffers. The assumptions and behaviors of this adapter parallel those of the ArrayAdapter:
If you need to modify how the objects display in the TextView, override their toString() method.
In addition, any DataBuffers added to this adapter are managed entirely by this adapter,
including their life cycle. Be sure to call clear()
anywhere you would otherwise close the data buffers used here, and if you want to manage
their life cycles more granularly, you will need to override the behavior of clear(), as well
as add your own management methods to ensure resources are properly managed within your
application.
If you need something other than a single TextView for the data in this adapter, override
getView(int, View, ViewGroup) to populate and return the type of view you
want.
|
DataBufferAdapter(Context
context, int resource, int textViewResourceId, List<DataBuffer<T>>
objects)
|
|
|
DataBufferAdapter(Context
context, int resource, int textViewResourceId)
|
|
|
DataBufferAdapter(Context
context, int resource)
|
|
| void | |
| void |
clear()
Closes and removes all buffers, and so all elements, from the adapter.
|
| Context | |
| int |
getCount()
|
| View | |
| T |
getItem(int position)
|
| long |
getItemId(int position)
|
| View | |
| void |
notifyDataSetChanged()
This will also re-enable automatic notifications. |
| void |
setDropDownViewResource(int resource)
Sets the layout resource to create the drop down views.
|
| void |
setNotifyOnChange(boolean notifyOnChange)
Control whether methods that change the list (
append(DataBuffer),
clear()) automatically call
notifyDataSetChanged().
|
Appends the specified buffer to the end of the adapter.
Closes and removes all buffers, and so all elements, from the adapter.
This will also re-enable automatic notifications. Pairing this with
setNotifyOnChange(boolean) gives the ability to make a series of changes to
the adapter without triggering multiple notifications at the same time. Use these two
methods together to temporarily disable notifications for the purpose of batching
operations on the adapter.
Sets the layout resource to create the drop down views.
Control whether methods that change the list (append(DataBuffer),
clear()) automatically call
notifyDataSetChanged(). If set to false, caller must manually call
notifyDataSetChanged() to have the changes reflected in the attached view.
The default is true, and calling notifyDataSetChanged() resets the flag to true. Use this method if you want to make several changes to the adapter in a row, and don't need the view to update in between changes. This reduces the processing load for each operation significantly.
| notifyOnChange | if true, modifications to the list will automatically call
notifyDataSetChanged() |
|---|