Code example for Spinner

Methods: getAdapter, getSelectedItemPosition

0
		alert.show();
		 
	} 
 
	public void onItemSelected(AdapterView<?> adapter, View v, int position,long arg3) {
		int index = gameplansSpinner.getSelectedItemPosition();
		String gameplanSelected = gameplansSpinner.getAdapter().getItem(index).toString();		
		//DigPlayDB db = DigPlayDB.getInstance(this); 
		//GamePlan newGameplan = db.getGameplanPlays(gameplanSelected);  
		//gameplanPlays = newGameplan.getGamePlan(game); 
		gameplanPlays = DigPlayDB.getInstance(getBaseContext()).getPlaysInGameplan(gameplanSelected);
 
		resetGameplanList(); 
		Toast toast = Toast.makeText(this, gameplanSelected, Toast.LENGTH_LONG);
		toast.show();
	} 
 
	public void onNothingSelected(AdapterView<?> arg0) {
		// TODO Auto-generated method stub 
		 
	}