title: MainActivity not running
body: <p>Help! I'm really new to Android Studio and not very good at it so please be as simple as possible when explaining things to me. Soo on the MainActivty for this app, its supposed to be where the user can enter data and then click a button and the data is displayed in the result activity using shared preferences... the rest of my app runs but when I tried running the mainactivity, it just closed out my avd. I'll include my code. can anyone see a reason why it wouldnt run?</p>
  
  <pre><code>package edu.wmich.games;
  
  import android.content.Intent;
  import android.content.SharedPreferences;
  import android.preference.PreferenceManager;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.EditText;
  
  public class MainActivity extends AppCompatActivity {
      String strName;
      String strEmail;
      int intGames;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          final EditText name = (EditText) findViewById(R.id.txtname);
          final EditText email = (EditText) findViewById(R.id.txtemail);
          final EditText games = (EditText) findViewById(R.id.txtnumber);
          Button btngamer = (Button) findViewById(R.id.btngames);
  
  
          final SharedPreferences sharedpref = PreferenceManager.getDefaultSharedPreferences(this);
  
          btngamer.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
              }
          });
  
                  strName = name.getText().toString();
          strEmail = email.getText().toString();
          intGames = Integer.parseInt(games.getText().toString());
  
          SharedPreferences.Editor editor = sharedpref.edit();
  
          editor.putString("keyName", strName);
          editor.putString("keyEmail", strEmail);
          editor.putInt("keyGames", intGames);
  
          editor.commit();
  
          startActivity(new Intent(MainActivity.this,Result.class));
  
  
          }
      }
  </code></pre>