Android-учебник по спиннеру и соответствующему будильнику
Я создаю приложение взаимодействия и уведомления о наркотиках - для одного раздела мне нужно выбрать элемент счетчика, а затем сигнал тревоги, чтобы скорректировать этот выбор счетчика.
пока у меня есть свой код для счетчика - вопрос в том, как добавить код аварийной сигнализации к corresspond к счетчику
public class Interactions extends Activity implements OnItemSelectedListener {
Spinner spinner;
TextView showmed;
private String[] state = {"Adalimumab",
"Etanercept",
"Tacrolimus",
"Mycophenolic Acid",
"Bicalutamide",
"Darbepoetin alfa",
"Ciclosporin",
"Interferon beta-1a",
"Triptorelin"};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_interactions);
System.out.println(state.length);
showmed = (TextView) findViewById(R.id.showmed);
spinner = (Spinner) findViewById(R.id.spinner);
ArrayAdapter<String> adapter_state = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, state);
adapter_state
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter_state);
spinner.setOnItemSelectedListener(this);
}
public void onItemSelected(AdapterView<?> parent, View view, int position,
long id) {
switch(position)
{
case 0:
showmed.setText("Azathioprine/cyclosporine\n" +
"Certain immunisupressive agents/live vacines\n" +
"Tumour necrosis factor blocking agents/ Abatacept\n"
"Immino suppressives/ Natalizub\n");
break;
case 1:
showmed.setText("Azathioprine/cyclosporine\n" +
"Certain immunisupressive agents/live vacines\n" +
"Tumour necrosis factor blocking agents/ Abatacept\n"
"Immino suppressives/ Natalizub\n");
break;
case 2:
showmed.setText("cyclosporine\n" +
"Efalizumab/Natalizumab\n" +
"QT Prolonging agents\n" +
"Mibefradil\n");
break;
case 3:
showmed.setText("Questran, Welchol. Colestipol\n" +
"Zovirax\n" +
"Azathiprine\n" +
"Avoid antacids\n");
break;
case 4:
showmed.setText("Warfine\n" +
"Terfenamine\n");
break;
case 5:
showmed.setText("lenaliodomide\n" +
"pomalidomide\n" +
"revlimid\n" +
"thalimd\n");
break;
case 6:
showmed.setText("birth control pills, \n" +
"caspofungin\n" +
"ezetimide\n" +
"sulfinpyrazone\n" +
"tacrolimus\n" +
"Drugs that weaken immune system\n" +
"acyclovir\n" +
"aminologycoside\n" +
"potassium supplements\n");
break;
case 7:
showmed.setText("Certain immunisupressive agents/live\n"
"Immino suppressives/ Natalizub\n");
break;
case 8:
showmed.setText("promethazine");
break;
case 9:
showmed.setText("No Test done");
}