0

I have a settings class. In this class I have a spinner, with 4 number. I want to use these numbers, in an another class to modify the program"s run. If the 3 is selected I want to be the thread for 3 sec, if 5 for 5 sec ... How can I store the spinner's position and use it in the another class?

Zwiebel
  • 1,605
  • 4
  • 21
  • 37

1 Answers1

2

What about implementing an onItemSelected event for your Spinner? Like the get the selected item changed post

Inside this event you can edit and store your value in the Android Shared Preferences

This will let you share your spinner actual value across all your activities/classes. Where you can get the value throught the dictionary.

Ask me if you don't understand.

Community
  • 1
  • 1
matiasnj
  • 604
  • 4
  • 13