Thursday, 10 October 2013

Excercise question for DEV Android, are you able solve the problem?

John created own lazyAdapter. His constructor had 3 arguments, first is for activity and the last two are for storing data. John decided add new elments by on his own.

John wanted first clear lazyAdapter's data and then add by his addItem method new items.

After compilation he noticed that something gone wrong. Images loaded correctly but somehow titles were not right.

Fields: images are storing urls in String, titles are storing titles of something in String.

Q:Can you figure out what was in title's text?

Q:What was causing the problem?

Q:How many elements will be in adapter in array titles after calling getView?

Picture #1

Picture #2