Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Android Lists and Adapters (2015) Custom ListViews Creating a Custom Adapter

i still do not understand why didn't we not extended the BaseAdapter instead of ArrayAdapter while creating dailyAdapter

While creating a dailyAdapter we extend the BaseAdapter. Will it work the same way if we had extended the ArrayAdapter?

Andre Du Plessis
Andre Du Plessis
4,874 Points

Yes, if your derived class requires the same functionality as Array Adapter it would be a good idea as a lot of the Array functionality is already implemented. You can then only override the functionality you want, but remember you can always call the base class' functionality as well from the overridden methods. However if you didn't want that functionality and create your own adapter from the ground up, it is better to start with the BaseAdapter class.

1 Answer

jenyufu
jenyufu
3,311 Points

We are basically starting from the ground up to have a better learning experience and learn it from the ground up. We could extend array adapter and that would work fine too, but its more like taking a shortcut. When you want to learn, take the normal route first. Then when you understand the normal route you can take all the shortcuts you want.