作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发一款安卓游戏 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/
我正在开发一款安卓游戏 https://code.google.com/p/something-soft/我的日志猫说它正试图激发游戏的 Intent ,但随后主线程似乎死了(出现 ActivityN
我是一名优秀的程序员,十分优秀!