0
[Solved]Android Studio -- pass view between classes
I am trying to pass a view between objects so I can update views(textboxes) from other classes, is this possible, or should I do it another way? https://code.sololearn.com/coTIkvpwR492/?ref=app https://code.sololearn.com/cAOmsBLKnyxv/?ref=app
4 Réponses
+ 2
You can create a reference variable of Question_generator inside the Arithmetic_operations class. And initialize the activity reference inside onCreate method. So, that you can use findViewById method inside Arithmetic_operations to get hold of any view from your activity.
Here is some code so that you can understand clearly
https://code.sololearn.com/cS8y0YQjfroZ/?ref=app
+ 1
Charlie Crease-huggett you can do it using the intent
+ 1
Dhananjay intents are used to pass information between activities, how would I use intents ?
0
Terminal_Phantom that's it, I've tried it and its worked perfectly. Thank you very much :)