title: android.content.ActivityNotFoundException: Unable to find explicit activity class - how to fix it?
body: <p>I have a very basic and yet annoying issue. I created new activities and pass the intent to move to them. Yet when I communicate the two:
  MainMenu and EventCreationActivity, I get the following error:</p>
  
  <p>android.content.ActivityNotFoundException: Unable to find explicit activity class {/com.mysampleapp.EventCreationActivity}; have you declared this activity in your AndroidManifest.xml?</p>
  
  <p>When I run the activities separately they work perfectly. 
  Here is the code of MainMenu</p>
  
  <pre><code>   package com.mysampleapp;
  
  
  import android.content.Context;
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.design.widget.FloatingActionButton;
  import android.support.design.widget.Snackbar;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.Toolbar;
  import android.view.View;
  import android.widget.Button;
  
  //import com.amazon.mysampleapp.R;
  
  public class MainMenu extends AppCompatActivity {
      //public final static String EXTRA_MESSAGE = "com.mysampleapp.MESSAGE";
      final Intent intent = new Intent(this, EventCreationActivity.class);
      Button newEvent;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main_menu);
          Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
  
          newEvent = (Button) findViewById(R.id.new_event_button);
  
          newEvent.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  startActivity(intent);
              }
          });
  
          getSupportActionBar().setDisplayHomeAsUpEnabled(true);
      }
  
  
  
  }
  </code></pre>
  
  <p>And manifest:</p>
  
  <pre><code>   &lt;application
          android:name=".Application"
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme"&gt;
          &lt;activity
              android:name=".SplashActivity"
              android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
              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;activity
              android:name=".MainActivity"
              android:label="@string/title_activity_main" /&gt;
          &lt;activity
              android:name=".LogInActivity"
              android:label="@string/title_activity_log_in"
              android:theme="@style/AppTheme"&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;activity
              android:name=".MainMenu"
              android:label="@string/title_activity_main_menu"
  
              android:theme="@style/AppTheme"&gt;
              &lt;!--android:parentActivityName=".LogInActivity"--&gt;
              &lt;!--&lt;meta-data--&gt;
                  &lt;!--android:name="android.support.PARENT_ACTIVITY"--&gt;
                  &lt;!--android:value="com.mysampleapp.LogInActivity" /&gt;--&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".MainDrawerActivity"
              android:label="@string/title_activity_main_drawer"
              android:theme="@style/AppTheme"&gt;
              &lt;!--&lt;meta-data--&gt;
                  &lt;!--android:name="android.support.PARENT_ACTIVITY"--&gt;
                  &lt;!--android:value="com.mysampleapp.MainMenu" /&gt;--&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".EventCreationActivity"
              android:label="@string/title_activity_event_creation"
  
              android:theme="@style/AppTheme"&gt;
              &lt;!--android:parentActivityName=".MainMenu"--&gt;
              &lt;!--&lt;intent-filter&gt;--&gt;
                  &lt;!--&lt;action android:name="android.intent.action.MAIN" /&gt;--&gt;
                  &lt;!--&lt;category android:name="android.intent.category.DEFAULT" /&gt;--&gt;
              &lt;!--&lt;/intent-filter&gt;--&gt;
              &lt;!--&lt;meta-data--&gt;
                  &lt;!--android:name="android.support.PARENT_ACTIVITY"--&gt;
                  &lt;!--android:value="com.mysampleapp.MainMenu" /&gt;--&gt;
          &lt;/activity&gt;
  </code></pre>
  
  <p>As you see, I commented some stuff in the Manifest file, but it did not help. I also looked other, similar questions and they did not help.</p>
  
  <p>Thanks in advance,
  John</p>