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 Data Persistence CRUD Operations with SQLite Displaying the Data

DEXUAN LI
DEXUAN LI
6,222 Points

Role of Adapter in Android

What does an adapter do in most of the cases? Why do we need to use an adapter?

Do I need to write costumed adapter or to use these provided by system in most cases?

1 Answer

Seth Kroger
Seth Kroger
56,413 Points

The Adapter pattern is a software design pattern where you change the interface of a class into the interface of a different class. In Android ListAdapters are the most recognizable because there solve a common problem: You have a list of data objects you want to display but the ListView excepts a list of View objects.

https://teamtreehouse.com/library/introduction-to-design-patterns specifically the video https://teamtreehouse.com/library/what-makes-a-pattern talks about the Adapter pattern