0

我想让这个微调器选择的值被保存(永远),直到你改变它,所以它会触发将它跳转到选定的项目意图。我已经尝试过 mPres_doctor 的东西,但我无法让它工作......这是我的鳕鱼。

android.widget.Spinner spinner3 = (android.widget.Spinner) findViewById(R.id.spinner3);
ArrayAdapter<CharSequence> adapter4 = ArrayAdapter.createFromResource(
        this, R.array.dinklass, android.R.layout.simple_spinner_item);
adapter4.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner3.setAdapter(adapter4);

    spinner3.setOnItemSelectedListener(new OnItemSelectedListener()
    {

            public void onItemSelected(AdapterView<?> arg0, View arg1,
                    int arg2, long arg3) {
                // TODO Auto-generated method stub

                switch (arg2) {
                case 0:                 
                    //Intent intent1 = new Intent(Schema.this, EKE1A.class);
                    //startActivity(intent1);                        
                    break;

                case 1:
                    Toast.makeText(getApplicationContext(), "Schema laddas...", Toast.LENGTH_SHORT).show();
                    Intent eke1a = new Intent(Schema.this, EKE1A.class);
                    startActivity(eke1a);                       
                    break;

等等。

4

0 回答 0