Lesson 2 How to exit your application and add a button, position it on the screen and set localizable caption on it
Another mysterious question I hit was " How do I exit my application? " Surprisingly there was almost no information on that subject. Originally surprising, but not for long. The secret is that normally you don't exit from your application the way you do in other languages like quit() in Python or return 0; in C++. The user just hit back button or hides your application by pressing Android '⭘' button. But what if you need to exit programmatically? Let's add to our newly created application a button (you should view activity_main.xml as shown): First, as shown in "Step 1", drag the button from Palette to the Component Tree. Most likely it will show up at the top left corner of the screen. To position it you need to add Constraints that will become visible in attributes. There are two ways to do that. Notice those wiggly lines going describing the position constraints. The prevent your button from taking all the space along with layout width and heig...