Project Name Issue when Importing Android Projects into Eclipse

This is a small issue with Eclipse when dealing with the ADT.

Question:

When importing projects into Eclipse, the name is not coming up correctly. Even though it should just be the name (ex. "HelloWorld"), the name is actually tied to the package name (ex. "com.blah.HelloWorld"). I personally like the smaller name for the "Project Name" as it is easier to deal with in the Project Navigator. This happens when using the "android" option under the import window. If I use the "general" option, the issue does not happen.

I can just stick to using the general option when importing, but I feel the android option should work just fine. Any ideas??


You can browse to menu Window > Preferences, select tab Java > Appearance. In box Abbreviate package name, replace the package name with a short string you prefer.

For example:

com.example.android={a}

Then all package names starting with com.example.android will be replace by {a} .


In my case, the project name is imported as MainActivity , always.
So I find some trick.
On AndroidManifest.xml , change activity name .MainActivity to the project name you want.
Then, import. You will success.
And re-change your manifest file.

链接地址: http://www.djcxy.com/p/61244.html

上一篇: 选择所有具有最大值的行

下一篇: 将Android项目导入Eclipse时的项目名称问题