我是 Android 开发的新手。在我将我的 eclipse 和 Android SDK 更新到最新版本后,我收到了一个警告:
Use '$' instead of '.' for inner classes (or use only lowercase letters in package names) AndroidManifest.xml
我在这个链接上找到了一些信息。
"When you reference an inner class in a manifest file, you must use '$' instead of '.' " +
"as the separator character, e.g. Outer$Inner instead of Outer.Inner.\n" +
"\n" +
"(If you get this warning for a class which is not actually an inner class, it's " +
"because you are using uppercase characters in your package name, which is not " +
"conventional.)"
我相信我在子包名称中使用了大写字符,例如com.abc.app.Promotion
.
问题是:在 manifest.xml 中消除此警告的最佳方法是什么?它仍然可以构建和运行,但我觉得它很烦人。
我尝试使用重构来重命名包并修改了 manifest.xmlandroid:name="com.abc.app.promotion.Promotion"
但得到了这个错误:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.abc.app/com.abc.app.TabView}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.abc.app/com.abc.app.promotion.Promotion}; have you declared this activity in your AndroidManifest.xml?
感谢您的帮助!
编辑:原始 manifest.xml
<activity android:name=".Promotion.Promotion" ></activity>
更新 manifest.xml
<activity android:name="promotion.Promotion" ></activity>