Change class view using buttons
<p>I'm trying to have a program go from one class to another by the press of a button. I know this needs to be done with intent, but I'm not sure exactly what action to use for intent. Also, i would rather not try to use OnClickListener since it seems to me to be a bit excessive for what I need to do. Though I could be wrong and I'm just over thinking it. Here's what I have for the code:</p>

<pre><code> public void loginScreen(View view) {
   // Should take user to the next view when button pressed
      Intent intent = new Intent(this, LoginActivity.class);
      Button login = (Button) findViewById(R.id.button1);
      intent.getData(login);
      startActivity(intent);
    }
</code></pre>

<p>I want it to go to the next screen when only button1 is pressed so i don't know if just lines 3 and 6 are the only ones needed, but it won't work if it's just those two. I believe the problem is getData, i don't know what to put there, but i know getData's wrong. I'm probably also missing something else, but I don't know what.</p>

<p>Also, forgive me if this isn't easy to follow, first time trying to ask a question here.</p>
