Перейти к содержимому

переменная


  • Please log in to reply
В этой теме нет ответов

#1
UNikolai

UNikolai

    Новичок

  • Пользователи
  • Pip
  • 1 сообщений

ArrayAdapter<String> spinners_adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, material);
spinners_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(spinners_adapter);
spinner.setPrompt("Материал");
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent,
View itemSelected, int selectedItemPosition, long selectedId) {
int i = 0;
double depth;
String for_search = spinner.getSelectedItem().toString();
while(!material_and_resistance[i].equals(for_search)){i++;}
depth=Double.parseDouble(vvod.getText().toString());
R1 = depth/Double.valueOf(material_and_resistance[i+1]);
textView.setText(for_search+material_and_resistance[i+1]+"+"+i);
textView2.setText(Double.toString(R1));// выводим выбранный пункт в TextView
textView3.setText(Double.toString(20.0-((0.115+R1)/(0.115+R1+R2))*45.0));


}
public void onNothingSelected(AdapterView<?> parent) {
}
});
ArrayAdapter<String> spinners_adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, material);
spinners_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(spinners_adapter);
spinner.setPrompt("Материал");
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent,
View itemSelected, int selectedItemPosition, long selectedId) {
int i = 0;
double depth;
String for_search = spinner.getSelectedItem().toString();
while(!material_and_resistance[i].equals(for_search)){i++;}
depth=Double.parseDouble(vvod.getText().toString());
R1 = depth/Double.valueOf(material_and_resistance[i+1]);
textView.setText(for_search+material_and_resistance[i+1]+"+"+i);
textView2.setText(Double.toString(R1));// выводим выбранный пункт в TextView
textView3.setText(Double.toString(20.0-((0.115+R1)/(0.115+R1+R2))*45.0));


}
public void onNothingSelected(AdapterView<?> parent) {
}
});?
Такой вот код, как получить в общее пользование переменную R1




Количество пользователей, читающих эту тему: 0

0 пользователей, 0 гостей, 0 анонимных