即使应用程序被杀死,eclipse android也会保存微调器值

时间:2012-10-10 18:21:23

标签: android button save spinner switch-statement

我想让这个微调选择值保存(永远),直到你改变它为止,因此它会跳转到选定的项目意图。我已经尝试过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;

等等。

0 个答案:

没有答案