Android Question How save a EditText reference?

rafaelmotaquintana

Active Member
Licensed User
I have this situation.
This Sub gets an edittext as a parameter, and I need to know after an activity resume, which edittext was used
B4X:
Sub SaveSettings(lText As EditText)
     StateManager.SetSetting("bigtext",lText.Text)       
End Sub

After an activity resume, I need to restore the original edittext, and I don't know which is.
If only I could save the name of the edittext or some reference.
 

rafaelmotaquintana

Active Member
Licensed User
The first options is the one I prefer, but StateManager.SetSetting only saves string.

If I could save the object, then after activity resume I could use

SAVEDEDITTEXT = StateManager.getsetting(something)
SAVEDEDITTEXT.TEXT = StateManager.SetSetting("savedtext")
 
Upvote 0
Top