0
I’m having a problem and I’m not finding a solution,
I have a string in a class java
, that string is: R.string.text
I will make a menu and put in the app preferences, to select only 1 option, and each option, will change the string.
Example
Menu with 3 options
Option 1 R.string.texto_verb
Option 2 R.string.texto_poetry
Option 3 R.string.text_phrase
If I click on option 2, my string in the other class java
will change text to text_poetry.
And I need this option to be stored.
I’m new to programming, so I need to ask you a few questions, André. The Minhaclasse class would be the class where I put the menu for choice, and the Main class is the one where I already have my string, right? And the menu I should do then in Minhaclasse? Thank you
– michaelsc
Hello, the Minhaclasse class has the responsibility of giving an option - which comes from the - menu and a string changes that string to another value according to its rule( can consider as its business rule ). The Main class is just to see if the business rule (which is implemented in the Minhaclasse class) is as expected. The Main class must be replaced by the class where Voce takes the menu options which in this case may be for example the click of a button or the Submit of a form, ai depends on how the user will select the option
– André