title: Unfortunately "App" has Stopped Android Studio
body: <p>I am new to developing android. 
  And I got after writing my code and running the debugger: "Unfortunately App has stopped"</p>
  
  <p><strong>my MainActivity.java</strong></p>
  
  <pre><code>package instaroggie.nl.content;
  
  import android.app.Activity;
  import android.app.ActionBar;
  import android.app.Fragment;
  import android.os.Bundle;
  import android.view.KeyEvent;
  import android.view.LayoutInflater;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.view.ViewGroup;
  import android.os.Build;
  import android.widget.ArrayAdapter;
  import android.widget.EditText;
  import android.widget.ListView;
  
  import java.util.ArrayList;
  import java.util.List;
  
  public class MainActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      ListView myListView = (ListView) findViewById(R.id.myListView);
      final EditText myEditText = (EditText) findViewById(R.id.myEditText);
  
      //create the Array List of to do items
      final ArrayList&lt;String&gt; todoItems = new ArrayList&lt;String&gt;();
  
      //create the Array Adapter to bind the array to the List View
      final ArrayAdapter&lt;String&gt; aa;
  
      aa = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, todoItems);
      myListView.setAdapter(aa);
  
      myEditText.setOnKeyListener(new View.OnKeyListener() {
          public boolean onKey(View v, int keyCode, KeyEvent event) {
              if (event.getAction() == KeyEvent.ACTION_DOWN)
                 if ((keyCode == KeyEvent.KEYCODE_DPAD_CENTER) ||
                          (keyCode == KeyEvent.KEYCODE_ENTER)) {
                      todoItems.add(0, myEditText.getText().toString());
                     aa.notifyDataSetChanged();
                     myEditText.setText("");
                     return true;
                  }
              return false;
          }
      });
  
      if (savedInstanceState == null) {
          getFragmentManager().beginTransaction()
                  .add(R.id.container, new PlaceholderFragment())
                  .commit();
      }
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
  
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();
      if (id == R.id.action_settings) {
          return true;
      }
      return super.onOptionsItemSelected(item);
  }
  
  /**
   * A placeholder fragment containing a simple view.
   */
  public static class PlaceholderFragment extends Fragment {
  
      public PlaceholderFragment() {
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          View rootView = inflater.inflate(R.layout.fragment_main, container, false);
          return rootView;
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>My activity_main.xml:</strong></p>
  
  <pre><code> &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/container"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MainActivity"
      tools:ignore="MergeRootFrame" /&gt;
  </code></pre>
  
  <p><strong>and my fragment_main.xml:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
  &lt;EditText
      android:id="@+id/myEditText"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:hint="@string/addItemHint"
      android:contentDescription="@string/addItemContentDescription"/&gt;
  
  &lt;ListView
      android:id="@+id/myListView"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Does anyone know where my problem is?</p>