如何摆脱警告:使用'$'而不是'.' 对于Eclipse中的内部类

EES*_*EES 19 java eclipse android

我是Android开发的新手.在我将我的eclipse和Android SDK更新到最新版本后,我收到了一个警告:

Use '$' instead of '.' for inner classes (or use only lowercase letters in package names)   AndroidManifest.xml
Run Code Online (Sandbox Code Playgroud)

我在这个链接上找到了一些信息.

"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.)"
Run Code Online (Sandbox Code Playgroud)

我相信我在子包名中使用了大写字符com.abc.app.Promotion.

问题是:在manifest.xml中摆脱此警告的最佳方法是什么?它仍然可以构建和运行,但我发现它很烦人.

我尝试使用重构来重命名包并修改了manifest.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?
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助!

编辑:原始manifest.xml

<activity android:name=".Promotion.Promotion" ></activity>
Run Code Online (Sandbox Code Playgroud)

更新了manifest.xml

<activity android:name="promotion.Promotion" ></activity>
Run Code Online (Sandbox Code Playgroud)

MBH*_*MBH 52

如果你对一个实际上不是内部类的类得到这个警告,那是因为你在包名中使用了大写字符,这不是常规的.

我还尝试将包名的第一个字母改为小写,警告消失了.