WEB开发网
开发学院手机开发Android 开发 Android 开发问题二则 阅读

Android 开发问题二则

 2010-04-18 17:20:00 来源:WEB开发网   
核心提示:出处:http://www.blogjava.net/crazycoding/archive/2010/03/27/316701.html三、在项目文件夹中新创建一个Java类或者直接修改自动生成的类文件出处:http://www.coderanch.com/t/466092/Android/Mobile/androi

出处:http://www.blogjava.net/crazycoding/archive/2010/03/27/316701.html

三、在项目文件夹中新创建一个Java类或者直接修改自动生成的类文件

出处:http://www.coderanch.com/t/466092/Android/Mobile/android-eclipse

以下是几个人的回复,感觉这种讨论的技术氛围很不错。今天太晚了,明天天亮还要去平谷,回来再翻译。

James Dixon的回复

Hi Divya

I’ve had the same problem as well. I think the issue is that the project creation does not initiate a build when it finishes, so you need to make a change, and save for it to generate the gen folder.

For me creating a new java class seemed to do the trick, but I’d imagine just making a change to a file and saving should work too.

Robert F. Howard的回复

I just ran into this, too. I am following the example in Hello Android, which I assume is what the others in this thread were doing. James’s solution (editing the source file) worked for me, so thank you for that.

So your solution is good, but I don’t think I totally believe the diagnosis. The thing is, the directory actually did exist before I edited the file and rebuilt. This is my first time using Eclipse, and it’s very disappointing. The error message should specify the full path of the directory it wants, and then it should be possible to create the directory and re-build, but it doesn’t work until the source file is edited. It makes me wonder what is really going on inside Eclipse.

Tim Holloway的回复

This seems to be a small glitch courtesy of Eclipse’s distancing itself from the OS filesystem (which is why Eclipse has an explicit Refresh command).

The gen folder and the “R.java” file are built by one of the Android utilities. The Eclipse Android plugin invokes this app, but it doesn’t always know when it needs to. I have similar problems when I want to define a new resource ID. Since I can’t seem to get the GUI resource ID definer to enable

Tags:Android 开发 问题

编辑录入:coldstar [复制链接] [打 印]
赞助商链接