如何摆脱警告:在 Eclipse 中使用“$”而不是“.”作为内部类
2022-09-02 00:20:57
我是安卓开发的新手。在我更新我的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
问题是:在清单中删除此警告的最佳方法是什么.xml?它仍然可以构建和运行,但我发现它很烦人。
我尝试使用重构重命名包并修改了清单.xml但收到此错误:android: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?
感谢您的帮助!
编辑:原始清单.xml
<activity android:name=".Promotion.Promotion" ></activity>
更新的清单.xml
<activity android:name="promotion.Promotion" ></activity>