Search code examples
androidandroid-activityandroid-manifest

android.content.ActivityNotFoundException:


I am getting this exception while I am trying to call an activity from another one. The complete exception is

android.content.ActivityNotFoundException:Unable to find explicit activity class {com.x.y/com.x.y.class};

I am doing an intent.setClass("com.x.y","com.x.y.className") where className is the name of my activity class and com.x.y is the package it resides in.

My AndroidManifest.xml has the following content:

<activity android:name="com.x.y.className" android:label="@string/app_name">

Am I missing anything?


Solution

  • Maybe you need to check that you added the new activity to the manifest.xml file

    Example:

    <activity
          android:name=".className" 
          android:label="@string/app_name" > 
    </activity>