The MainActivity class

The default project generated with Empty Activity also created a default MainActivity.java file. In the hierarchy pane, locate the app/java/ directory that contains a subdirectory named com.cardbookvr.skeleton.

Note

Note, this is different than the androidTest version of the directory, we're not using that one! (Your name may vary based on the actual project and domain names given when you created the project.)

In this folder, double-click on the MainActivity.java file to open it for editing. The default file looks like this:

package com.cardbookvr.skeleton; import ... public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ...

Get Cardboard VR Projects for Android 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.