0
Why my method doesnt see variables
Hello Sololearn,pls help me to fix my code my method myFunc() doesnt see variables Pls look at this code https://code.sololearn.com/cUCLmU2OjVPf/?ref=app
3 Answers
+ 1
You need to pass your variables as arguments to the function. Then you will be able to use them.
+ 1
Normally, I've had TextBox and EditText as class variables, which you can then populate in your methods. This allows all methods to have access to them. You could pass them as arguments too, but at the moment they are all declared in the on#click methods, so they will be limited to that scope unless you pass as a parameter
0
Thanks for everybody,I have fixed my code.Thanks