Android Question SetValue in TabHost Edittext Element

hasexxl1988

Active Member
Licensed User
Longtime User
Hello,
I have a problem when reading values, as in the code can be seen, the values stored normal and read.

Now I have the problem that, although values from txtName can be stored, but this text box can (txtName) will not pass any values, therefore I can stored no longer read.

txtName is in the LayoutFile of ConfigTAB.

How can I pass from my active Activity a string to the text box in the ConfigTAB?

I can not add the "EditText" element to Process_Global

I can Read the Value from txtName on the Main Activity.

B4X:
Sub Globals
    Dim TabHost_Config As TabHost
    Dim txtName as Edittext
End Sub

Sub Activity_Create(FirstTime As Boolean)
    TabHost_Config.AddTab ("ConfigTAB", "Config") 'Config is a Layout File
End Sub

Sub loadconfig
    sets = File.ReadMap(File.DirInternal, "config.set")
    txtName.Text = sets.Get("Name")
End Sub

Sub saveconfig
    File.WriteMap(File.DirInternal, "config.set", sets)
    sets.Put("Name", txtName.Text)
End Sub
 

hasexxl1988

Active Member
Licensed User
Longtime User
Have Founded the Error :D

B4X:
    sets = File.ReadMap(File.DirInternal, "config.set")
    txtName.Initialize ("txtName")
    txtName.Text = sets.Get("txtName")

The txtName.Initialize ("txtName") was the Source auf error :)
 
Upvote 0
Top