title: errors in main_activity.java file
body: <blockquote>
    <p>cannot find symbol class intent, cannot find...Activity2.class, cannot find...Activity-main </p>
  </blockquote>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  Button button;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
      onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      button = (Button) findViewById(R.id.MyButton);
  
      button.setOnClickListener(new OnClickListener() {
          public void onClick(View arg0) { 
              // Start NewActivity.class
              Intent myIntent = new Intent(MainActivity.this,
                      NewActivity2.class);
              startActivity(myIntent);
              }
          });
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          getMenuInflater().inflate(R.menu.activity_main, menu);
          return true;
      }
  }
  </code></pre>
  
  <p>all the imports precede the above code like import widget button, etc.</p>