android – How to modify androidmanifest.xml to use a class that extends ListActivity?-ThrowExceptions

Exception or error:

I have two classes one that extends Activity and inside that class file I called another intent which class extends ListActivity. How do I change the androidmanifest.xml file to load that two activities? I should say that I declared both of the activities in androidmanifest.xml file as

<activity android:name="NoteActivity"></activity>
<activity android:name="AddNote"></activity>

the NoteActivity extends Activity and the AddNote extends ListActivity; when I run it it doesn’t run and said “stopped” unfortunately.

How to solve:

You need to define your newly created activities in manifest too. So simply update your AndroidManifest.xml at least as minimum as below:

<activity android:name=".NoteActivity" android:label="Activity1" />

<activity android:name=".AddNote" android:label="Activity2" />

*It is assumed that your activity files are placed in root of your package as defined in manifest and make sure the class names are correctly depicted in the xml above.

Note: Make sure your activity starts with a dot (.) symbol too.

Leave a Reply

Your email address will not be published. Required fields are marked *