I’m getting an ActivityNotFoundException in my Android Application.. Here’s the code snippet I have put to call the activity :
Intent i = new Intent();
i.putExtra("NAME", username.getText().toString());
i.setClassName(getPackageName(), SecondActivity.class.getSimpleName());
startActivity(i);
my AndroidManifest.xml looks like this
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rangde"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA"/>
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" >
<activity android:name=".firstActivity" android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="@string/app_name" android:name=".SecondActivity" />
<activity android:label="@string/app_name" android:name=".WelcomeActivity" />
</application>
</manifest>
When I execute the code snippet with the intent, I get the following exception.
E/AndroidRuntime(731): android.content.ActivityNotFoundException:
Unable to find explicit activity class {com.rangde/WelcomeActivity};
have you declared this activity in your AndroidManifest.xml?
Can someone tell me what I’m doing wrong?
1 Answer