简体   繁体   English

写入行“ R”时,eclipse(ADT)崩溃。

[英]eclipse(ADT) crashing when writing line include “R.”

I downloaded the Android Development Tools SDK which include Eclipse and SDK . 我下载了包含EclipseSDKAndroid开发工具 SDK The Eclipse IDE crashes when i try to write a line that include "R." 当我尝试编写包含“ R”的行时, Eclipse IDE崩溃 , like: , 喜欢:

EditTex Password= (EditText)FindViewById(R.id.pass)

It won't show the error, it just crashes. 它不会显示错误,只会崩溃。

You should use: R.id.yourControlId 您应该使用: R.id.yourControlId

In the autogenerated class R are you're ID's stored for multiple things like your resources; 在自动生成的类R中,您是ID的存储对象,例如资源。 images/strings etc.. 图片/字符串等。

To get your images from your drawable folder: R.drawable.image 要从可绘制文件夹中获取图像: R.drawable.image
To get your string from your strings.xml: R.string.hello_world 要从strings.xml中获取字符串,请执行以下操作: R.string.hello_world

So you should do this instead: EditText Password = (EditText)FindViewById(R.id.pass); 因此,您应该这样做: EditText Password = (EditText)FindViewById(R.id.pass);

I have the problem, too, seems to be a bug in the openjdk in connection with the ADT. 我也有问题,似乎是与ADT有关的openjdk中的错误。 This has nothing to do with the code you write in eclipse. 这与您在eclipse中编写的代码无关。 It can be triggered in more ways. 可以通过更多方式触发它。 And it seems that it is no problem with eclipse itself, because it is no Java-Exception but the javavm that segfaults. 而且看来eclipse本身没有问题,因为它不是Java异常,而是segfaults的javavm。 Looking for a workaround myself atm. 我正在寻找自动柜员机的解决方法。

Edit: May be this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=404776 Edit2: And this here may be a workaround: https://bugs.eclipse.org/bugs/show_bug.cgi?id=404776#c7 编辑:可能是这个bug: https: //bugs.eclipse.org/bugs/show_bug.cgi ? id = 404776 Edit2:这可能是一种解决方法: https : //bugs.eclipse.org/bugs/show_bug。 CGI?ID = 404776个#C7

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM