To display the details of a selected data item in a RecyclerView, I'll use the same techniques as in the list’s individual items: a set of TextView and ImageView objects, laid out in a RelativeLayout view group. But because the detail presentation has the entire screen to work with, the images and fonts can be larger. When the detail activity opens, the first task is to get an object containing the data you want to display.
- [Instructor] Do display the details…of a selected DataItem in a DetailActivity,…I'll use the same techniques as I do in…recycler views individual items.…The activity layout will have a set of text view…and image objects laid out in a relative layout…view group.…First let's set up the layout.…I'm working in the project display details now,…and I'll go to my resources folder to layout,…and open activity_detail.xml.…Now, rather than coding this all,…I'll go to a gist that I've already set up…and I'll get to it through a short url of…git.io/vi2Qu.…
And that expands to this activity detail layout.…And I'll select all of that code…and copy it,…and then I'll paste it into this file,…replacing all of the existing code.…And then I'll look at it in design view.…So I have an item name at the top,…a price in the top right,…a larger image in the center,…and then a longer description, a text view, at the bottom.…This is pretty conventional layout code.…Next I'll go get code to display this information.…I'll go to my detail activity,…
- 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.