Saturday, 24 August 2013

Android - Where should I place my listeners?

Android - Where should I place my listeners?

I'm having problems trying to work out where to put my listeners (I have
two listeners I'm trying to setup but will only reference one here and
hopefully will be able to work the second one out for myself!).
I have a spinner and want to update some TextViews when the spinner item
changes so think I want an onItemSelected listener. I have tried putting
it in the onCreate method and onStart method after reading someone else's
question on SO but the app will just FC when it loads.
The app uses Tabs/Fragments for navigation, could this be something to do
with the problem (Fragments not inflated when trying to set the listener)?

No comments:

Post a Comment