0
とアンドロイドスピナーvalus方法は何がしたいことは同じことを行うことです、コーディングを減らすために、私は別の方法やsprate方法を意味し、これを実行するが、別の方法であるが、diffreent方法で別の方法
public static final int spinner1_op_val = 50;
public static final int spinner2_op_val = 10;
public static final int spinner3_op_val = 50;
Spinner spinner1 = (Spinner)findViewById(R.id.spinner1);
ArrayList<Integer> spinner1_options = new ArrayList<>();
for (i = 0; i <= spinner1_op_val; i += 1) {
spinner1_options.add(Integer.valueOf(i));
}
ArrayAdapter<Integer> dataAdapter_for_spinner1 = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, spinner1_options);
dataAdapter_for_spinner1.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);
spinner1.setAdapter(dataAdapter_for_spinner1);
spinner1.setSelection(4);
spinner1.setOnItemSelectedListener(this);
Spinner spinner2 = (Spinner) findViewById(R.id.spinner2);
ArrayList<Integer> spinner2_options = new ArrayList<>();
for (i = 0; i <= spinner2_op_val; i++) {
spinner2_options.add(Integer.valueOf(i));
}
ArrayAdapter<Integer> dataAdapter_for_spinner2 = new ArrayAdapter<>(this,R.layout.support_simple_spinner_dropdown_item,spinner2_options);
dataAdapter_for_spinner2.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);
spinner2.setSelection(2);
spinner2.setAdapter(dataAdapter_for_spinner2);
spinner2.setOnItemSelectedListener(this);
Spinner spinner3 = (Spinner) findViewById(R.id.spinner3);
ArrayList<Integer> spinner3_option = new ArrayList<>();
for (i = 0; i <= spinner3_op_val; i += 5) {
spinner3_option.add(Integer.valueOf(i));
}
ArrayAdapter<Integer> dataAdapter_for_spinner3 = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, spinner3_option);
dataAdapter_for_spinner3.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);
spinner3.setAdapter(dataAdapter_for_spinner3);
spinner3.setSelection(2);
spinner3.setOnItemSe
lectedListener(this);
エクストラエクストラエキストラエキスエキステキストエキスパートエキスパート