Skip to Content
Android 9 Development Cookbook - Third Edition
book

Android 9 Development Cookbook - Third Edition

by Rick Boyer
October 2018
Intermediate to advanced
464 pages
15h 17m
English
Packt Publishing
Content preview from Android 9 Development Cookbook - Third Edition

How to do it...

To insert a widget into a layout, follow these steps:

  1. Open the activity_main.xml file in Android Studio and click on the Design tab. As you can see, by default, Android Studio adds a TextView to the layout. Select the TextView and delete it:
  1. Find Button in the widget list and drag it to the center of the activity screen on the right:
  1. Though we placed the button in the center of the screen, the button will not actually be centered when you run the app. If we want it centered, we need to set the layout properties accordingly. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Android Application Development Cookbook - Second Edition

Android Application Development Cookbook - Second Edition

Rick Boyer, Kyle Mew
Android High Performance Programming

Android High Performance Programming

Enrique López Mañas, Diego Grancini
Android Things Projects

Android Things Projects

Francesco Azzola

Publisher Resources

ISBN: 9781788991216Supplemental Content