【发布时间】:2011-10-06 22:01:34
【问题描述】:
我是学习 Android 的新手,我忘记了很多 Java 程序。这里有个问题我今天在Eclipse中执行程序。
public void cvOnClick (View cvView) {
EditText KilogramsInput = (EditText) findViewById(R.id.Kilograms);
EditText HeightInput = (EditText) findViewById(R.id.Height);
TextView BmiOutput = (TextView) findViewById(R.id.Bmi);
DecimalFormat BmiFormat = new DecimalFormat(".#####");
Double Heightdouble = Math.pow(Integer.parseInt(HeightInput.getText().toString()), 2);
String outcome = BmiFormat.format(Integer.parseInt(KilogramsInput.getText().toString())/Heightdouble);
BmiOutput.setText(outcome);
}
作为这个程序的最初目的,应该是高度的平方数。在Eclipse中执行没有错误。但是当我将数据(十进制)放入 AVD 时,它显示:the application has stopped unexpectedly。
请告诉我此刻我能做什么?
感谢您的所有帮助!布拉德
【问题讨论】: