Code example for Spinner

Methods: setAdapter, setOnItemSelectedListener

0
	} 
	 
	public SpinnerDialog( String title, String message, String[] items, Activity activity, final SpinnerDialogListener listener ){
		super( activity );
		 
		mSpinner = new Spinner( activity );				
		mSpinner.setAdapter( new ArrayAdapter<String>( activity, android.R.layout.simple_spinner_item, items ) );
		 
		mSpinner.setOnItemSelectedListener( new OnItemSelectedListener() {
        	public void onItemSelected( AdapterView<?> adapter, View view, int position, long id ) 
        	{ 
        		mSelected = position;
        	} 
        	 
        	public void onNothingSelected(AdapterView<?> arg0) {}
		}); 
         
		this.setTitle( title );
		this.setMessage( message );
		this.setView( mSpinner );