关于微调器和相应报警的Android教程
我正在构建一个药物交互和通知应用程序-对于一个部分,我需要选择一个微调器项,然后使用该微调器选项向CorresPond发出警报 到目前为止,我已经有了微调器的代码-问题是如何将警报代码添加到微调器的CorresPond中关于微调器和相应报警的Android教程,android,android-studio,spinner,alarm,Android,Android Studio,Spinner,Alarm,我正在构建一个药物交互和通知应用程序-对于一个部分,我需要选择一个微调器项,然后使用该微调器选项向CorresPond发出警报 到目前为止,我已经有了微调器的代码-问题是如何将警报代码添加到微调器的CorresPond中 public class Interactions extends Activity implements OnItemSelectedListener { Spinner spinner; TextView showmed; private St
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");
}
问题是什么?抱歉,问题是如何将警报代码添加到CorresPond到微调器