我已经查看了所有问题。我编写了代码并且没有错误,但我仍然收到相同的消息。我能做些什么只是告诉我一个我自己解决它的方法
public class RunningSum extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_running_sum);
Button sum = (Button) findViewById(R.id.button1);
Button cancel = (Button) findViewById(R.id.button2);
EditText from = (EditText) findViewById(R.id.editText1);
EditText upto = (EditText) findViewById(R.id.editText2);
final EditText rsum = (EditText) findViewById(R.id.editText3);
final int from1 = Integer.valueOf(from.getText().toString());
final int upto1 = Integer.valueOf(upto.getText().toString());
final int rsum1 = Integer.valueOf(rsum.getText().toString());
cancel.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
}
});
sum.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
for(int x=from1; from1<=upto1; x++){
int summ = 0;
summ += from1;
rsum.setText(summ);
}
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_running_sum, menu);
return true;
}
}