Questions about the ArrayAdapter


#1

I have a couple of questions from around p. 187 regarding “Creating an adapter subclass”.

  1. We pass in 0 for the “resource” argument when calling the superclass constructor because we aren’t using a pre-defined layout. Is this a typical pattern? I’m curious because the API doc doesn’t mention “Pass in 0 if you’re not using a pre-defined layout.”. If I were only reading the doc I wouldn’t have thought I could pass in a value that isn’t bound to an existing layout (and I guess the reason is because I don’t know enough to understand who is depending on this value).

  2. I don’t understand who is calling getView()? Its obviously being called because I made a mistake in mine and got errors (now fixed). :slight_smile:


#2

OK, I see that getView() is called once for each item that is displayed and viewable. I’m just not sure where its getting called.