开发者

What is wrong with my AndroidManifest.xml?

开发者 https://www.devze.com 2023-02-27 03:47 出处:网络
I am trying to develop a basic app to display information in 2 tabs, and from my understanding the info in each tab needs to have its own activity, in addition to the one for the tabs. I have done thi

I am trying to develop a basic app to display information in 2 tabs, and from my understanding the info in each tab needs to have its own activity, in addition to the one for the tabs. I have done this, all of the java code looks right, and I have declared all 3 activities in my AndroidManifest.xml. When I launch the app, it crashes on start, and when I run logcat, I find:

java.lang.RuntimeException: Unable to start activity ComponentInfo{android.wingdom.convention/android.wingdom.convention.TabWidget}: android.content.ActivityNotFoundException: Unable to find explicit activity class {android.wingdom.convention/android.wingdom.convention.Schedule}; have you declared this activity in your AndroidManifest.xml?

I keep doublechecking the file, and I dont see anything wro开发者_如何学运维ng, it currently looks like this:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="android.wingdom.convention"
  android:versionCode="1" android:versionName="1.0">

<application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".TabWidget"
              android:label="@string/app_name"
          android:theme="@android:style/Theme.NoTitleBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
<activity android:name=".Map" />
<activity android:name=".Schedule" />
</activity>

</application>


You are defining activities in your activity.

Try the following code instead:

<activity android:name=".TabWidget"
              android:label="@string/app_name"
          android:theme="@android:style/Theme.NoTitleBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
</activity>
<activity android:name=".Map" />
<activity android:name=".Schedule" />
0

精彩评论

暂无评论...
验证码 换一张
取 消