Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a new activity to the AndroidManifest?

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?

like image 923
Alex H. Avatar asked Sep 30 '10 16:09

Alex H.


People also ask

How do I declare an activity in manifest xml?

There are several other attributes that you can include in this element, to define properties such as the label for the activity, an icon for the activity, or a theme to style the activity's UI. The android:name attribute is the only required attribute—it specifies the class name of the activity.

How do I edit AndroidManifest xml?

The Android manifest file is a specially formatted XML file. You can edit the XML manually by clicking on the AndroidManifest. xml tab. Android manifest files generally include a single <manifest> tag with a single <application> tag.


1 Answers

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.

like image 177
Octavian A. Damiean Avatar answered Oct 03 '22 11:10

Octavian A. Damiean