0
我想在兩個editText中獲得輸入值的乘積。例如,我將在xValues中輸入[1,2,3,4,5],然後我將在freqValues中輸入[6,7,8,9,10],然後它將乘以(1 * 6),(2 * 7),(3 * 8),(4 * 9),(5 * 10)。我將如何做到這一點?請幫幫我。謝謝提前:)如何在兩個edittext中獲得輸入值的乘積?
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];
}
});