我制作了一个简单的android应用程序,我从1个活动的EditText值进行了一些计算,一些乘法,求和和其他数学程序,并在另一个活动edittexs中将结果显示为双倍。所以有人可以告诉我是否有必要转换字符串值为进行计算而“加倍”,我该怎么做?
Activity1.java
Intent ic = new Intent(Calculator_1Activity.this,Calculator2a.class);
ic.putExtra("e1", et1.getText().toString());
ic.putExtra("e2", et2.getText().toString());
ic.putExtra("e3", et3.getText().toString());
ic.putExtra("e4", et4.getText().toString());
ic.putExtra("e5", et5.getText().toString());
ic.putExtra("e6", et6.getText().toString());
ic.putExtra("e7", et7.getText().toString());
ic.putExtra("e8", et8.getText().toString());
startActivity(ic);
我在activity2a中获取它的值,但不能进行计算..请帮助..:(
Activity2a.java
Intent receiveIntent = this.getIntent();
String etz1 = receiveIntent.getStringExtra("e1");
String etz2 = receiveIntent.getStringExtra("e2");
String etz3 = receiveIntent.getStringExtra("e3");
String etz4 = receiveIntent.getStringExtra("e4");
String etz5 = receiveIntent.getStringExtra("e5");
String etz6 = receiveIntent.getStringExtra("e6");
String etz7 = receiveIntent.getStringExtra("e7");
String etz8 = receiveIntent.getStringExtra("e8");
et1.setText(etz1);
et2.setText(etz2);
et3.setText(etz3);
et4.setText(etz4);
et5.setText(etz5);
et6.setText(etz6);
et7.setText(etz7);
et8.setText(etz8);
请帮我