Android manifest.xml
I'm working on the Tabs example from Google Android Developers site (http://developer.android.com/resources/tutorials/views/hello-tabwidget.html) but I'm stuck in step 2.
At the very end of step 2 says "Duplicate this for each of the three activities, an开发者_开发问答d add the corresponding tags to the Android Manifest file"
What exactly do I have to add to the AndroidManifest.xml?
Thanks
This is how your Manifest file should be:
<activity android:name=".ArtistsActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<activity android:name=".SongsActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<activity android:name=".AlbumsActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
</application>
This will work for sure!!
just add every activity AndroidManifest.xml
main activity use:
<activity android:name=".Tabs">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
another activity use:
<activity android:name=".Tab1">
<intent-filter>
<action android:name="android.intent.action.EDIT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Basically you have register each activities in AndroidManifest.xml like this
<activity android:name=".YourActivityName"/>
You have to add the corresponding <activity>
tags for each one of the three activities. The AndroidManifest.xml file describes the components of the application (amongst other things like permissions and API level support).
In this example you have to add three definitions:
<activity android:name=".ArtistsActivity"/>
<activity android:name=".AlbumsActivity"/>
<activity android:name=".SongsActivity"/>
精彩评论