In fact, the docs page for Adapter: http://developer.android.com/reference/android/widget/Adapter.html
... says this: An Adapter object acts as a bridge between an AdapterView<http://developer.android.com/reference/android/widget/AdapterView.html> and the underlying data for that view. The Adapter provides access to the data items. The Adapter is also responsible for making a View<http://developer.android.com/reference/android/view/View.html> for each item in the data set. So the concept of "underlying data" is present right away, and so is the notion that an adapter is what connects the UI to that data. -- Kostya 6 января 2012 г. 0:53 пользователь John Davis <[email protected]> написал: > Hello Kris, > > Yes, that is a good way to put it. Thanks for the info. > > John > > > On Thu, Jan 5, 2012 at 3:37 PM, Kristopher Micinski < > [email protected]> wrote: > > On Thu, Jan 5, 2012 at 2:18 PM, John Davis <[email protected]> wrote: > >> Hello > >> > >> Ok. So I appreciate the help. Here is the summary: > >> > >> for (int i=0;i<count;i++) { > >> // If it is the 2nd or 5th item, tag it so that it will > be > >> displayed in blue. > >> if (i==2 || i==5) { > >> listCount = adapter.getCount(); > >> count = theList.getCount(); > >> fooString = (String) > theList.getItemAtPosition(i); > >> Log.d(TAG, "position "+i+"has string "+ > fooString); > >> // fooView = (TextView) theList.getChildAt(i); > >> // Log.d(TAG, "position "+i+"has view id > "+fooView.getId()); > >> > >> // fooView.setTag(99); > >> } > >> > >> This code will work. The stuff that is commented out pertaining to > >> getChildAt does not. I'll try to get that working. I suspect it will > >> not work since the view is not up and running yet. As it is now, it > >> will crash when the getChild call is made. > >> > >> Thanks for the help, this is becoming more clear. Pity the docs were > >> not more clear. "returns the data" is so generic. > >> > > > > That might be your interpretation too. I think most people would > > argue (since most people realize that the list is an adapter backed > > view) that indeed 'the data' would make much more sense as the thing > > in the adapter, preferring to call the GUI object 'the view.' > > > > I have actually found that -- while necessarily incomplete (to the > > extent that it's impossible logistically to document everything) -- > > the Android API documentation is extremely high quality: assuming you > > have some knowledge of how the framework fits together. (Which is why > > the documentation is simply that, a reference rather than a tutorial.) > > > > kris > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > > http://groups.google.com/group/android-developers?hl=en > > > > -- > John F. Davis > > 独树一帜 > > > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

