gpt4 book ai didi

机器人(异常 ActityNotFoundException)

转载 作者:行者123 更新时间:2023-11-29 22:26:43 28 4
gpt4 key购买 nike

我正在开发一款安卓游戏 https://code.google.com/p/something-soft/我的日志猫说它正试图激发游戏的 Intent ,但随后主线程似乎死了(出现 ActivityNotFoundException),然后似乎卡住了。

在代码存储库中,我已经提交了除/bin 之外的所有文件...包括最新的 logcat 输出(/trunk/KingLand/log.txt)和调试器输出(/trunk/KingLnad/debug.txt)

我正在运行的模拟器是具有 2024MiB 内存的 Android 平台 2.1-update1,如果这真的会导致任何问题(我不确定)

如有任何帮助,我们将不胜感激。

编辑:AndroidManifest.xml

$<?xml version="1.0" encoding="utf-8"?>
$ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
$ package="android.app"
$ android:versionCode="1"
$ android:versionName="1.0">
$ <application android:icon="@drawable/icon" android:label="@string/app_name">
$ <activity android:name="com.Something.Soft.KingsLand"
$ android:label="@string/app_name">
$ <intent-filter>
$ <action android:name="android.intent.action.MAIN" />
$ <category android:name="android.intent.category.LAUNCHER" />
$ </intent-filter>
$ </activity>
$ <activity android:name=".Tutorial"
$ android:label="@string/tutorial"
$ android:theme="@android:style/Theme.Dialog"/>
$ <activity android:name=".Prefs"
$ android:label="@string/settingsTitle"/>
$ <activity android:name=".Game" // this is the where the intent should fire to
$ android:label="@string/gameTitle"/>
$ </application>
$</manifest>

最佳答案

package 属性应该是您的 Activity 所在的包。

在您的 AndroidManifest.XML 中,manifest 标签应该在属性 package 上声明您的 Activity 所在的包。

它将是:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.Something.Soft"
android:versionCode="1"
android:versionName="1.0">
//The others attributes.

您定义了:“package="android.app""你的 Activity 在 com.Something.Soft 上

您还应遵循代码约定,包名全部小写。

关于机器人(异常 ActityNotFoundException),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5707885/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com