Skip to Main Content
Android Programming with Kotlin for Beginners
book

Android Programming with Kotlin for Beginners

by John Horton
April 2019
Beginner to intermediate content levelBeginner to intermediate
698 pages
15h 15m
English
Packt Publishing
Content preview from Android Programming with Kotlin for Beginners

Adding buttons to the main layout file

Here, we will add a couple of buttons to the screen and will then explore a quick way to make them do something. We will add a button in two different ways; first, using the visual designer, and second, by adding to and editing the XML code directly.

Adding a button via the visual designer

To get started adding our first button, switch back to the design view by clicking on the Design tab underneath the XML code that we have just been discussing. The button is highlighted in the following screenshot:

Adding a button via the visual designer

Notice that in the left-hand side of the layout, we have a window that is called Palette:

The palette window is ...

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

Programming Android with Kotlin

Programming Android with Kotlin

Pierre-Olivier Laurence, Amanda Hinchman-Dominguez, Mike Dunn, G. Blake Meike
How to Build Android Apps with Kotlin - Second Edition

How to Build Android Apps with Kotlin - Second Edition

Alex Forrester, Eran Boudjnah, Alexandru Dumbravan, Jomar Tigcal
Java to Kotlin

Java to Kotlin

Duncan McGregor, Nat Pryce

Publisher Resources

ISBN: 9781789615401Supplemental Content