Well I got your point on creation. So I did some more digging/ experimentation and am pretty sure it is calling on the same Activity and same Spinner instance i.e. the newly created instance after the orientation change. I did this by putting a count in activity and also printing the references.
Yes I am using Fragments in my program but for this isolated spinner test I was just using the tutorial which does not use fragments (Just to keep things simple as well as use the code of the creators...which I assume to be correct...:)). Well right now I am just doing nothing to get over this ( at least Loaders are smart and for other things lets see how they work out) but the behavior is in-consistent (even though i rule out, not adhering to api documentation (which clearly says will be called only if the selection changes))...:) Thanks for discussing...one always learn new things this way. On Dec 28, 6:35 am, Mark Murphy <mmur...@commonsware.com> wrote: > On Tue, Dec 27, 2011 at 8:35 PM, havexz <bali.param...@gmail.com> wrote: > >> You are assuming that it is the same Spinner object and the same > >> OnItemSelectedListener. Instead, it is a completely different Spinner > >> instance and a completely different OnItemSelectedListener instance, > >> for a completely different fragment instance in a completely different > >> activity instance. > > > What you mean by this? There is only one spinner having one dedicated > > inner class listener for it. > > When you change configurations, such as changing screen orientation, > your original activity is destroyed and a brand new activity is > created. That brand-new activity will create its own static fragment, > which will create its own Spinner and listener. > > > Since the above code is from tutorial, > > there is no Fragment involved. It is a very basic implementation. > > You said: > > > Well I am using fragments but create from xml. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > Android Training...At Your Office:http://commonsware.com/training -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en