Reputation: 9101
I have declared a intent to access another layout on a button click, When it was run I getting following error,
android.content.ActivityNotFoundException: Unable to find explicit activity class xxxxxx; have you declared this activity in your AndroidManifest.xml?
From this I understood that intent need to be declared in android manifest file but I don't know how to declare.
Can anyone explain me how to declare<
Thanks in advance Siva
Upvotes: 1
Views: 8119
Reputation: 2351
you need to declare your activity in android manifest.xml here is an example:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package.name">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Activity1" android:label="@string/app_name"></activity>
<activity android:name=".Activity2"></activity>
</application>
<uses-sdk android:minSdkVersion="4" />
</manifest>
Upvotes: 2
Reputation: 3874
u missed some like .helloListView in manifest, even check for the dot.
<activity android:name=".helloListVeiw"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Upvotes: 1