I have spinner which including many items and want when I click on one item from those items it open another activity
here is the spinner in layout
<Spinner android:id="@+id/spinner" android:layout_width="fill_parent" android:layout_height="wrap_content" android:prompt="@string/title" android:entries="@array/items" /> here is the items in string
<string name="title">select</string> <string-array name="items"> <item>open activity one</item> <item>open activity two</item> </string-array> here is the code that i want to make it able to open another activity when i click on the items
Spinner Spinner = (Spinner) findViewById(R.id.spinner); Spinner.setOnItemSelectedListener(new OnItemSelectedListener() { public void onClick(View v) { // TODO Auto-generated method stub } @Override public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub } @Override public void onNothingSelected(AdapterView<?> arg0) { // TODO Auto-generated method stub } });