Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com

The content view is once again id'd by activity_main,...

containing a vertical LinearLayout...

with a TextView label and a Button.

When the button is pushed, a second activity is started.

To get a reference to the MainActivity instance we need to use MainActivity.this, since we're inside the OnclickListener, so just 'this' would refer to this OCL.

Activity2.class is of course the other class, instantiated by the system.

Its content is id'd by activity_activity2,...

also a LinearLayout, but with just a TextView showing the text Screen 2.

You can set text as shown with the 1st activity's TextView,...

but the proper way is this roundabout way,..

via strings.xml. That contains the actual string...

and in the layout xml just its id tvtext is mentioned. The idea is that you can have texts in different languages to be used by the app. We'll let that be for now.