I'm trying to make a simple program where if I go and click a button in my app a new activity pops up that asks to input a browser. Here's the Exception I keep recieving:
02-26 04:38:11.900 1937-1937/? E/AndroidRuntime: FATAL EXCEPTION: main
android.content.ActivityNotFoundException: Unable to find explicit activity class
{com.course.example.widgets/com.course.example.widgets.WebLookup};
have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1618)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1417)
at android.app.Activity.startActivityForResult(Activity.java:3370)
at android.app.Activity.startActivityForResult(Activity.java:3331)
at android.app.Activity.startActivity(Activity.java:3566)
at android.app.Activity.startActivity(Activity.java:3534)
at com.course.example.widgets.Widgets.onClick(Widgets.java:139)
at android.view.View.performClick(View.java:4204)
at android.view.View$PerformClick.run(View.java:17355)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Here's my manifest xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.course.example.widgets"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Widgets"
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:name="com.course.example.widgets.WebLookup"
android:label="@string/app_name"/>
</application>
<uses-sdk android:minSdkVersion="17" />
<uses-permission android:name="android.permission.CALL_PHONE" />
</manifest>
Here's the code that actually starts the activity:
case R.id.webButton:{
Intent webLookup = new Intent(this, WebLookup.class);
startActivity(webLookup);
break;
It's in a switch block that is for determining 3 other button actions but I didn't think it was relevant.
Here's a picture of XML file and my two Java files in navigator on left.