Spinners always have a selection, unless their Adapter is empty. On Wed, Nov 2, 2011 at 1:48 PM, shashi asanka <[email protected]> wrote: > I used following Code .... > > > > Spinner sp= new Spinner(this); > sp=(Spinner)findViewById(R.id.spinner1); > > sp.setOnItemSelectedListener(new OnItemSelectedListener() { > > @Override > public void onItemSelected(AdapterView<?> items, View > v, > int arg2, long arg3) { > // TODO Auto-generated method stub > //v.isc > Log.d("RRR", Long.toString(arg2)); > //cb= items.getItemAtPosition(arg2).toString(); > //Log.d("AA123", arg2); > } > > @Override > public void onNothingSelected(AdapterView<?> arg0) { > // TODO Auto-generated method stub > > } > }); > > > When i run the program, I didn't select any things from Spinner but it > consider i select one thing . How to avoid this pls help ..... > > -- > 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 >
-- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android 3.2 Programming Books: http://commonsware.com/books -- 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

