title: App crashes when button is hit although no errors shown
body: <p>I'm trying to build an app with four different activities. </p>
  
  <p>On my start page, there are 4 buttons. When you click on a button you should be directed to the correspondent activity. </p>
  
  <p>Although my code has no syntax errors, my app always crashes when I hit a single button. </p>
  
  <p>Can some please tell me what is wrong with my code?</p>
  
  <p><strong>My MainActivity</strong></p>
  
  <pre><code>package com.group6.travlhoe;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.annotation.IdRes;
  import android.support.annotation.NonNull;
  import android.support.design.widget.BaseTransientBottomBar;
  import android.support.design.widget.BottomNavigationView;
  import android.support.v7.app.ActionBarActivity;
  import android.support.v7.app.AppCompatActivity;
  import android.view.MenuItem;
  import android.view.View;
  import android.widget.Button;
  import android.widget.TextView;
  
  public class MainActivity extends AppCompatActivity implements 
  View.OnClickListener {
  
  Button btnTransport, btnUnterkunft, btnAllgemein, btnRechnung;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      btnTransport = (Button) findViewById(R.id.Transport);
      btnAllgemein = (Button) findViewById(R.id.Allgemein);
      btnUnterkunft = (Button) findViewById(R.id.Unterkunft);
      btnRechnung = (Button) findViewById(R.id.Rechnung);
  
      btnTransport.setOnClickListener(this);
      btnRechnung.setOnClickListener(this);
      btnAllgemein.setOnClickListener(this);
      btnUnterkunft.setOnClickListener(this);
  }
  
  
  @Override
  public void onClick(View v) {
      if (v.getId() == R.id.Allgemein) {
          startActivity(new Intent(MainActivity.this, Allgemein.class));
      } else if (v.getId() == R.id.Transport) {
          startActivity(new Intent(MainActivity.this, Transport.class));
      } else if (v.getId() == R.id.Unterkunft) {
          startActivity(new Intent(MainActivity.this, Unterkunft.class));
      } else if (v.getId() == R.id.Rechnung) {
          startActivity(new Intent(MainActivity.this, Rechnung.class));
      }
      }
  }
  </code></pre>
  
  <p><strong>One of the classes the button should direct to:</strong></p>
  
  <pre><code>package com.group6.travlhoe;
  
  import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  
  
  
  public class Allgemein extends AppCompatActivity {
  
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_allgemein);
      }
  }
  </code></pre>
  
  <p><strong>My Error Log-File</strong>:</p>
  
  <pre><code>06-22 17:33:17.073 1414-1600/? E/AudioFlinger: not enough memory for AudioTrack size=131296
  06-22 17:33:17.073 1414-1600/? E/AudioFlinger: createRecordTrack_l() initCheck failed -12; no control block?
  06-22 17:33:17.073 2269-10242/? E/AudioRecord: AudioFlinger could not create record track, status: -12
  06-22 17:33:17.074 2269-10242/? E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -12.
  06-22 17:33:17.074 2269-10242/? E/android.media.AudioRecord: Error code -20 when initializing native AudioRecord object.
  06-22 17:33:22.111 1414-1599/? E/AudioFlinger: not enough memory for AudioTrack size=131296
  06-22 17:33:22.111 1414-1599/? E/AudioFlinger: createRecordTrack_l() initCheck failed -12; no control block?
  06-22 17:33:22.111 2269-10242/? E/AudioRecord: AudioFlinger could not create record track, status: -12
  06-22 17:33:22.120 2269-10242/? E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -12.
  06-22 17:33:22.120 2269-10242/? E/android.media.AudioRecord: Error code -20 when initializing native AudioRecord object.
  06-22 17:33:26.330 1517-1530/? E/memtrack: Couldn't load memtrack module
  06-22 17:33:27.159 1414-1499/? E/AudioFlinger: not enough memory for AudioTrack size=131296
  06-22 17:33:27.159 1414-1499/? E/AudioFlinger: createRecordTrack_l() initCheck failed -12; no control block?
  06-22 17:33:27.159 2269-10242/? E/AudioRecord: AudioFlinger could not create record track, status: -12
  06-22 17:33:27.165 2269-10242/? E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -12.
  06-22 17:33:27.166 2269-10242/? E/android.media.AudioRecord: Error code -20 when initializing native AudioRecord object.
  06-22 17:33:32.203 1414-1499/? E/AudioFlinger: not enough memory for AudioTrack size=131296
  06-22 17:33:32.203 1414-1499/? E/AudioFlinger: createRecordTrack_l() initCheck failed -12; no control block?
  06-22 17:33:32.203 2269-10242/? E/AudioRecord: AudioFlinger could not create record track, status: -12
  06-22 17:33:32.211 2269-10242/? E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -12.
  06-22 17:33:32.211 2269-10242/? E/android.media.AudioRecord: Error code -20 when initializing native AudioRecord object.
  06-22 17:33:37.259 1414-1599/? E/AudioFlinger: not enough memory for AudioTrack size=131296
  06-22 17:33:37.259 1414-1599/? E/AudioFlinger: createRecordTrack_l() initCheck failed -12; no control block?
  06-22 17:33:37.260 2269-10242/? E/AudioRecord: AudioFlinger could not create record track, status: -12
  06-22 17:33:37.265 2269-10242/? E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -12.
  06-22 17:33:37.265 2269-10242/? E/android.media.AudioRecord: Error code -20 when initializing native AudioRecord object.
  06-22 17:33:42.359 1414-1414/? E/AudioFlinger: not enough memory for AudioTrack size=131296
  06-22 17:33:42.360 1414-1414/? E/AudioFlinger: createRecordTrack_l() initCheck failed -12; no control block?
  06-22 17:33:42.360 2269-10242/? E/AudioRecord: AudioFlinger could not create record track, status: -12
  06-22 17:33:42.366 2269-10242/? E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -12.
  06-22 17:33:42.368 2269-10242/? E/android.media.AudioRecord: Error code -20 when initializing native AudioRecord object.
  06-22 17:33:47.604 1414-1599/? E/AudioFlinger: not enough memory for AudioTrack size=131296
  06-22 17:33:47.606 1414-1599/? E/AudioFlinger: createRecordTrack_l() initCheck failed -12; no control block?
  06-22 17:33:47.652 2269-10242/? E/AudioRecord: AudioFlinger could not create record track, status: -12
  06-22 17:33:47.824 2269-10242/? E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -12.
  06-22 17:33:47.825 2269-10242/? E/android.media.AudioRecord: Error code -20 when initializing native AudioRecord object.
  06-22 17:33:47.835 2269-10242/? E/ActivityThread: Failed to find provider info for com.google.android.apps.gsa.testing.ui.audio.recorded
  06-22 17:33:48.125 1517-1530/? E/memtrack: Couldn't load memtrack module
  06-22 17:33:48.760 1417-1573/? E/installd: Failed to delete /data/app/vmdl1116498233.tmp: No such file or directory
  06-22 17:33:48.930 2154-4609/? E/NetworkScheduler.SR: Invalid parameter app
  06-22 17:33:48.930 2154-4609/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
  06-22 17:33:49.162 2656-2656/? E/Finsky: [2] com.google.android.finsky.wear.bl.a(3): onConnectionFailed: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
  06-22 17:33:49.272 2154-4609/? E/NetworkScheduler.SR: Invalid parameter app
  06-22 17:33:49.272 2154-4609/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
  06-22 17:33:49.547 1342-1342/? E/hw-IPCThreadState: binder thread pool (1 threads) starved for 130 ms
  06-22 17:33:49.752 2269-9548/? E/ContentStoreEUAS: Failed to commit the deferred actions
  06-22 17:33:51.037 1352-1368/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
  06-22 17:33:51.525 2154-4609/? E/ctxmgr: [AppIntervalImpl]closeInterval: ongoing
  06-22 17:33:51.545 2154-2383/? E/UidImportanceUtils: exception when invoking removeOnUidImportanceListener
                                                       java.lang.reflect.InvocationTargetException
                                                           at java.lang.reflect.Method.invoke(Native Method)
                                                           at alvy.a(:com.google.android.gms:1123)
                                                           at akva.a(:com.google.android.gms:44820)
                                                           at lsx.a(:com.google.android.gms:246)
                                                           at akuz.run(:com.google.android.gms:2812)
                                                           at android.os.Handler.handleCallback(Handler.java:769)
                                                           at android.os.Handler.dispatchMessage(Handler.java:98)
                                                           at alxb.dispatchMessage(:com.google.android.gms:3028)
                                                           at android.os.Looper.loop(Looper.java:164)
                                                           at android.os.HandlerThread.run(HandlerThread.java:65)
                                                        Caused by: java.lang.IllegalArgumentException: Listener not registered: alvz@2c93e02
                                                           at android.app.ActivityManager.removeOnUidImportanceListener(ActivityManager.java:3628)
                                                           at java.lang.reflect.Method.invoke(Native Method) 
                                                           at alvy.a(:com.google.android.gms:1123) 
                                                           at akva.a(:com.google.android.gms:44820) 
                                                           at lsx.a(:com.google.android.gms:246) 
                                                           at akuz.run(:com.google.android.gms:2812) 
                                                           at android.os.Handler.handleCallback(Handler.java:769) 
                                                           at android.os.Handler.dispatchMessage(Handler.java:98) 
                                                           at alxb.dispatchMessage(:com.google.android.gms:3028) 
                                                           at android.os.Looper.loop(Looper.java:164) 
                                                           at android.os.HandlerThread.run(HandlerThread.java:65) 
  06-22 17:33:53.354 1517-1608/? E/TaskPersister: File error accessing recents directory (directory doesn't exist?).
  06-22 17:34:00.005 1517-1530/? E/memtrack: Couldn't load memtrack module
  </code></pre>
  
  <p><strong>Android Manifest File:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.group6.travlhoe"&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:roundIcon="@mipmap/ic_launcher_round"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/app_name"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>