Activity Preference edit to Label???

Fox

Active Member
Licensed User
Longtime User
Hey guys i have follow problem.

i want to assign an edit from preferences to an label. my code is follow:

Sub CreatePreferenceScreen
screen.Initialize("Einstellungen", "")
Dim cat1, cat2, cat3 As AHPreferenceCategory
Dim intentScreen As AHPreferenceScreen
cat1.AddEditText("edit1", "EditText1", "This is TestEdit", "", "check1")
End sub

The user can input an text in the editbox and then it should show in an label.

i have tried follow

manager.GetString("edit1") = Label1.text

but no success

anyone can help.
 

Penko

Active Member
Licensed User
Longtime User
manager.GetString("edit1") returns the saved preference. What you are doing is trying to set something to it.

In order to show it in the label, you have to reverse the direction:

B4X:
label1.Text = manager.GetString("edit1")

But I am not sure you are saving the settings(you haven't shown us where you are doing it).
 
Upvote 0

Fox

Active Member
Licensed User
Longtime User
manager.GetString("edit1") returns the saved preference. What you are doing is trying to set something to it.

In order to show it in the label, you have to reverse the direction:

B4X:
label1.Text = manager.GetString("edit1")

But I am not sure you are saving the settings(you haven't shown us where you are doing it).

:BangHead: ahhh i'm so stupid sometimes :) thank you for your help :sign0060: works fantastic :sign0098:
 
Upvote 0
Top