It had exception error, something wrong with code, but i can't find out.
Is there anyone help me? thank you
private Spinner s;
        s = (Spinner) findViewById(R.id.dailylog_type);
        ArrayAdapter adapter = ArrayAdapter.createFromResource(
                this, R.array.planets_type,
android.R.layout.simple_spinner_item);

 adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        s.setAdapter(adapter);
        s.setOnItemSelectedListener(selectListener);

private Spinner.OnItemSelectedListener selectListener = new
OnItemSelectedListener() {
        public void onItemSelected(AdapterView parent, View v, int position,
long id) {
         int pos = s.getSelectedItemPosition();
            switch (pos) {
            case 1:
             Intent i_1 = new Intent(class1.this,class2.class);
             startActivity(i_1);
             break;
            case 2:
             Intent i_2 = new Intent(class1.this,class3.class);
             startActivity(i_2);
             break;
            }
        }
        public void onNothingSelected(AdapterView arg0) {}
    };

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to