开发者

How do I get Eclipse to recognize R and the resources in Android's Lunar Lander?

I'm trying to create the Lunar Lander example for Android in Eclipse, but some of the code is not compiling. Anywhere in the code that references "R." is giving me errors. At first it was saying that R was not开发者_JS百科 recognized or declared, so I imported it from Android via the quick fix menu. But now the resources that are referenced after the R are not being recognized.

How can I fix this? Thanks!


I think u import android.R U have to import com.example.android.lunarlander.R


try to use getResource() to reference R


I have this problem all the time, the problem for me was that there was a file in my hdpi resources which was (res\drawable-hdpi\image.xcf) not a jpg. it was a xcf. and deleting this solved the issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜