32

I'm on a new android project - just a simple one. I have three "tabs" (activity1,2,3) with different tasks.

Anyways, how do I add these 3 activities do the AndroidManifest?

my manifest;

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.comics"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".Comics"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
    <uses-sdk android:minSdkVersion="4" />

</manifest> 

Yeah, so where do i put it in?

Adam Peck
  • 6,930
  • 3
  • 23
  • 27
Alex H.
  • 341
  • 1
  • 4
  • 4

2 Answers2

60

You put it inside of your application element, like this:

<?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>

Where .Activity2 is your second activity.

Octavian Helm
  • 39,405
  • 19
  • 98
  • 102
  • 1
    I would upvote this a thousand times if I could. I spent **hours** trying to figure what was wrong - I *did* add my activity to manifest file, but not inside `application` tags. Thanks a lot for mentioning that little detail, no other place stresses this out! – Filipe Gonçalves Mar 01 '14 at 22:17
16

Inside <application> tag of manifest you can add new activity like:

<activity android:name=".newActivity"/>
Mithun
  • 2,075
  • 3
  • 19
  • 26
SREEJITH
  • 816
  • 1
  • 8
  • 19