title: App crashes on launch in emulator
body: <p>I'm new in android development and I'm trying to build a kind of book listing kind of app for a project in my class. The prof's favorite motto is "whatever you don't know google it". That's not bad when you semi-know what to do but since we are learning java along with android development that's not helpful since java can seem a bit alien.</p>
  
  <p>Anyways basing my app in a contact app this is how my MainActivity looks</p>
  
  <pre><code>//MainActivity.java
  package com.iekproject.siegfried.libraryapp;
  
  import android.net.Uri;
  import android.os.Bundle;
  import android.os.Environment;
  import android.support.v4.app.FragmentTransaction;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.Toolbar;
  
  public class MainActivity extends AppCompatActivity
     implements LibraryFragment.LibraryFragmentListener, DetailFragment.DetailFragmentListener,
      AddEditFragment.AddEditFragmentListener {
  
  //key for storing a book's Uri in a Bundle passed to a fragment
  public static final String BOOK_URI = "book_uri";
  
  private LibraryFragment libraryFragment; //displays library aka book list
  
  //displays LibraryFragment when MainActivity first loads
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  
     super.onCreate(savedInstanceState);
     setContentView(R.layout.activity_main);
     Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
     setSupportActionBar(toolbar);
  
      //if layout contains fragmentContainer, the phone layout is in use. Create and display
      //a LibraryFragment
      if (savedInstanceState == null &amp;&amp; findViewById(R.id.fragmentContainer) != null) {
          //create LibraryFragment
          libraryFragment = new LibraryFragment();
  
          //add the fragment to the FrameLayout
          FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
          transaction.add(R.id.fragmentContainer, libraryFragment);
          transaction.commit(); //displays LibraryFragment
      }
      else {
          libraryFragment =
                  (LibraryFragment) getSupportFragmentManager().
                          findFragmentById(R.id.DetailFragment);
      }
  }
  
  public boolean isExternalStorageReadable() {
      String state = Environment.getExternalStorageState();
      if (Environment.MEDIA_MOUNTED.equals(state) ||
              Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
          return true;
      }
      return false;
  }
  
  //displays DetailFragment for selected book
  @Override
  public void onBookSelected(Uri bookUri) {
          getSupportFragmentManager().popBackStack();
          displayBook(bookUri, R.id.rightPaneContainer);
  }
  
  //displays AddEditFragment to add a new book. Possibly what I'll also have to change to make it
  //scan/update the book list
  @Override
  public void onAddBook() {
          displayAddEditFragment(R.id.rightPaneContainer, null);
  }
  
  //displays a book
  private void displayBook(Uri bookUri, int viewID) {
      DetailFragment detailFragment = new DetailFragment();
  
      //specify book's Uri as an argument to the DetailFragment
      Bundle arguments = new Bundle();
      arguments.putParcelable(BOOK_URI, bookUri);
      detailFragment.setArguments(arguments);
  
      //use a FragmentTransaction to display the DetailFragment
      FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
      transaction.replace(viewID, detailFragment);
      transaction.addToBackStack(null);
      transaction.commit(); //causes DetailFragment to display
  }
  
  //displays fragment for adding new or editing existing book
  private void displayAddEditFragment(int viewID, Uri bookUri) {
      AddEditFragment addEditFragment = new AddEditFragment();
  
      //if editing existing book, provide bookUri as an argument
      if (bookUri != null) {
          Bundle arguments = new Bundle();
          arguments.putParcelable(BOOK_URI, bookUri);
          addEditFragment.setArguments(arguments);
      }
  
      //use a FragmentTransaction to display the AddEditFragment
      FragmentTransaction transaction =
              getSupportFragmentManager().beginTransaction();
      transaction.replace(viewID, addEditFragment);
      transaction.addToBackStack(null);
      transaction.commit(); //causes AddEditFragment to display
  }
  
  //return to book list when displayed book deleted
  @Override
  public void onBookDeleted() {
      //removes top of back stack
      getSupportFragmentManager().popBackStack();
      libraryFragment.updateLibrary(); //refresh book list
  }
  
  //displays the AddEditFragment to edit an existing book. Maybe it can be used as Move or sth
  /*@Override
  public void onEditBook(Uri bookUri) {
      displayAddEditFragment(R.id.rightPaneContainer, bookUri);
  }*/
  
  //update GUI after the new book or updated book saved
  @Override
  public void onAddEditCompleted(Uri bookUri) {
      //removes top of back stack
      getSupportFragmentManager().popBackStack();
      libraryFragment.updateLibrary(); //refresh book list
  
      if (findViewById(R.id.fragmentContainer) == null){ //tablet
          //removes top of back stack
          getSupportFragmentManager().popBackStack();
  
          //on tablet, displays the book that was just added or edited
          displayBook(bookUri, R.id.rightPaneContainer);
      }
    }
  }
  </code></pre>
  
  <p>and this is the logcat</p>
  
  <pre><code>04-12 16:14:38.807 5796-5796/? I/art: Not late-enabling -Xcheck:jni (already on)
  04-12 16:14:38.808 5796-5796/? W/art: Unexpected CPU variant for X86 using defaults: x86
  04-12 16:14:38.926 5796-5796/com.iekproject.siegfried.libraryapp W/System: ClassLoader referenced unknown path: /data/app/com.iekproject.siegfried.libraryapp-1/lib/x86
  04-12 16:14:38.945 5796-5796/com.iekproject.siegfried.libraryapp I/InstantRun: starting instant run server: is main process
  04-12 16:14:38.991 5796-5796/com.iekproject.siegfried.libraryapp W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
  04-12 16:14:39.119 5796-5796/com.iekproject.siegfried.libraryapp D/AndroidRuntime: Shutting down VM
  04-12 16:14:39.119 5796-5796/com.iekproject.siegfried.libraryapp E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                     Process: com.iekproject.siegfried.libraryapp, PID: 5796
                                                                                     java.lang.RuntimeException: Unable to start activity ComponentInfo{com.iekproject.siegfried.libraryapp/com.iekproject.siegfried.libraryapp.MainActivity}: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.
                                                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
                                                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
                                                                                         at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
                                                                                         at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                         at android.os.Looper.loop(Looper.java:154)
                                                                                         at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                                         at java.lang.reflect.Method.invoke(Native Method)
                                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
                                                                                      Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.
                                                                                         at android.support.v7.app.AppCompatDelegateImplV9.setSupportActionBar(AppCompatDelegateImplV9.java:207)
                                                                                         at android.support.v7.app.AppCompatActivity.setSupportActionBar(AppCompatActivity.java:130)
                                                                                         at com.iekproject.siegfried.libraryapp.MainActivity.onCreate(MainActivity.java:30)
                                                                                         at android.app.Activity.performCreate(Activity.java:6679)
                                                                                         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                                                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
                                                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) 
                                                                                         at android.app.ActivityThread.-wrap12(ActivityThread.java) 
                                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) 
                                                                                         at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                         at android.os.Looper.loop(Looper.java:154) 
                                                                                         at android.app.ActivityThread.main(ActivityThread.java:6119) 
                                                                                         at java.lang.reflect.Method.invoke(Native Method) 
                                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
                                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 
  </code></pre>
  
  <p>any help is appreciated</p>