我想得到两个editTexts中输入值的乘积。例如,我将在 xValues 中输入 [1,2,3,4,5] 然后我还将在 freqValues 中输入 [6,7,8,9,10] 然后它将乘以 (1*6),(2*7 ),(3*8),(4*9),(5*10)。我将如何做到这一点?请帮我。先感谢您:)
final AutoCompleteTextView xValues = (AutoCompleteTextView) findViewById(R.id.x_Values);
final AutoCompleteTextView freqValues = (AutoCompleteTextView) findViewById(R.id.frequency_Values);
Button btnCalculate = (Button) findViewById(R.id.btncalculate);
btnCalculate.setOnClickListener(new OnClickListener(){
public void onClick(View arg0)
{
String[]x = ( xValues.getText().toString().split(","));
String []freq = ( freqValues.getText().toString().split(","));
int[]convertedx=new int[x.length];
int[]convertedfreq=new int[freq.length];
}
});