On Sat, Mar 13, 2010 at 11:07 PM, murali raju <[email protected]> wrote:

> use spinner.setOnItemClickListener(new OnItemClickListener()
>

No, this won't work, read the documentation: "A spinner does not support
item click events."
You want setOnItemSelectedListener().

On Sat, Mar 13, 2010 at 11:51 PM, Nitesh Mehta <[email protected]> wrote:

> Well i already know how to get the item and which index. My problem is that
> the index is same irrespective of what was selected in spinner 1. How do i
> know whether spinner 1 was selected or spinner 2?


Read the documentation:

http://developer.android.com/intl/de/reference/android/widget/AdapterView.OnItemSelectedListener.html#onItemSelected(android.widget.AdapterView<?>,
android.view.View, int, long)

The first parameter is the AdapterView that triggered the listener, in your
case this would be the Spinner.
Or you could also set a different listener on each spinner ......

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking

-- 
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