I have a class that consists of an edittext box to hold a string “strResponse” I want to access this string in another class. Basically a user types in whatever, and the other class takes that string, and sends it in a text message.
That code works fine if I hard code it in. But I want a user to define what the message should say from the other class.
I was thinking global variable, but have had no luck so far.
I have a class that consists of an edittext box to hold a string
Share
what do you mean by hardcode it? could you post your code here?
normally, a decent oop design isn’t class 1 “takes” values from class 2, if class 2 is the one which is taking inputs from the user.
The design should be something, class 2 takes input and once input is done it sends/flag/notify class 1 for updated value.
sends/flag/notify could be done by different ways. depends on the design.