0
在我的android应用程序中有一个叫做swap的按钮。现在我想交换两个微调器之间的值。 我创建做微调如下:从微调器交换两个值
fromSpinner = (Spinner) findViewById(R.id.fromSpinner);
ArrayAdapter<CharSequence> adapter1 = ArrayAdapter.createFromResource(
this, R.array.from_currency_array,
android.R.layout.simple_spinner_item);
toSpinner = (Spinner) findViewById(R.id.toSpinner);
ArrayAdapter<CharSequence> adapter2 = ArrayAdapter.createFromResource(
this, R.array.to_currency_array,
android.R.layout.simple_spinner_item);
swap.setOnClickListener(new Button.OnClickListener() {
//swap logic here
});
任何人可以帮助我写的方法?