A custom array adapter is extended from the ArrayAdapter class and manages a specific type of data. It has a getView() method that's called automatically by the superclass each time the adapter needs to fill in data to present on the screen. This is where you put your code to display text and images, and to otherwise manage what the user sees.
- [Instructor] I'm working on displaying list items…in a listview component.…And so far I've created this list item layout file…that displays one data item…with an image view and a text view.…And I'm using a graphic file that's…in the drawable resource folder.…My next step is to create a new java class,…which will extend the array adapter class.…And I'll put that in the base package of the application.…I'll create the new java class…and I'll name it data item adapter.…And it's going to extend the array adapter class.…
I'll type array adapter and click okay.…After the class has been created…and I've deleted the automatically created comment…I will also set the generic declaration to data item.…I'm saying that this array adapter is going…to manage data item objects rather than simple strings.…Then there's a warning indicator…and I'll use an intention action…and I'll create a constructor…that matches the super classes constructor.…Now there are a few different versions of this.…I'm going to expand this so we can see everything.…
- Modeling data in POJO classes
- Customizing a ListView item display
- Displaying data in a RecyclerView
- Creating a custom array adapter
- Managing shared preferences with Java
- Creating and importing JSON data files
- Accessing SQLite from the command line
- Retrieving data with SQLite queries
Skill Level Intermediate
Android App Development: Data Persistence Librarieswith Annyce Davis3h 59m Intermediate
Android App Development: RESTful Web Serviceswith David Gassner2h 25m Intermediate
1. Display Static Data
2. Store Data in Shared Preferences
About shared preferences4m 41s
3. Store Data in Text Files
4. Manage Relational Data with SQLite
Next steps1m 43s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.