Tuesday, December 27, 2011

[android-developers] Spinner spinning twice...

I am having issues with spinner for the past 2 days. And then I
isolated the problem by using the working Spinner tutorial at

http://developer.android.com/resources/tutorials/views/hello-spinner.html

So I am able to reproduce the issue. The code is exactly same as
mentioned in the above link. Then I modified the selection listener
as:

spinner.setOnItemSelectedListener(new
AdapterView.OnItemSelectedListener() {

@Override
public void onItemSelected(AdapterView<?> arg0, View arg1, int pos,
long id) {
Log.i(TAG, "SPINNER SELECTED pos: " + pos + " id: " + id);
}

@Override
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub

}
});

Now if I select Mercury which is the first element and change
orientation then this log statement is called once.

If I choose Earth which is the third element and change orientation
then this log statement is called twice with same values of pos, id
etc. pretty much with in a short span.

And so on.....

So my question is this a bug? Am I missing some thing? As this leads
to lot of issues when I using Loaders or AsyncTask etc.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate