Public class extends. SetListAdapter new this

 

Public onCreate

Super onCreate

SetContentView

 

SetListAdapter new this

 

FindViewById

 

 

Public onListItemClick

 

SetText

 

 

Things get a wee bit challenging when you realize that in everything up to this point in this chapter, never were we actually changing the itself. All our work was with the adapters, overriding and inflating our own rows and whatnot.

So if we want to take in any ordinary and “just work,” putting checkboxes on the rows as needed, we are going to need to do some fancy footwork. Specifically, we are going to need to wrap the “raw” in some other that knows how to put the checkboxes on the rows and track the state of those checkboxes.

First we need to establish the pattern of one augmenting another. Here is the code for , which takes a and delegates all of the interface’s methods to the delegate (from the sample project at http://apress.com/):

Public class implements

Null

 

Public AdapterWrapper

This

 

 

Public getCount

Return getCount

 

 

Public getItem

Return getItem

 

 

Public getItemId

Return getItemId

 

 

Public getView

 

Return getView

 

 

Public registerDataSetObserver

RegisterDataSetObserver

 

 

Public hasStableIds

Return hasStableIds

 

 

Public isEmpty

Return isEmpty

 

 

Public getViewTypeCount

Return getViewTypeCount

 

 








Дата добавления: 2015-05-16; просмотров: 860;


Поиск по сайту:

При помощи поиска вы сможете найти нужную вам информацию.

Поделитесь с друзьями:

Если вам перенёс пользу информационный материал, или помог в учебе – поделитесь этим сайтом с друзьями и знакомыми.
helpiks.org - Хелпикс.Орг - 2014-2024 год. Материал сайта представляется для ознакомительного и учебного использования. | Поддержка
Генерация страницы за: 0.004 сек.