Building a UI with CardView and ScrollView

Create a new project in the usual way. Name the project CardView Layout. Leave the Target Android Devices section on the default settings and choose the Empty Activity project template. On the Configure Activity screen, uncheck the option to Generate Layout File because we will handle that ourselves. The activity name can be left as the default of MainActivity. The following screenshot shows these final settings:

Building a UI with CardView and ScrollView

To be able to edit our theme and properly test the result, we need to generate our layout file and edit the Java code to display it by calling the setContentView method from the onCreate method. ...

Get Android Programming for Beginners - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.