U
unba1300
Guest
Hi. I have an activity that loads a layout which contains a scrollview, and then with code, I add ten edittexts and populate their values from a list. This works well with the exception of going back to the app after the Home key was pressed. Depending on if I initialize the scrollview and load the layout in Activity_Create or Activity_Resume, the results are different, and both undesirable. The first attachment shows what the activity normally looks like, the second after returning from home with the init and load in Activity_Create (the outline around the edittext that has focus is incomplete and FocusChanged no longer selects the text), and the third after returning from home with the init and load in Activity_Resume (the instructions in the label become more and more 'bold' each time and notice the ghosting in the edittext near the top). Could someone please help shed some light on what is wrong? (I had to crop the images to get the size down for posting).
I do not have a problem when the emulator is rotated.
B4X:
Sub Activity_Create(FirstTime As Boolean)
svPeople.Initialize(500dip)
Activity.LoadLayout("LayoutPeople")
End Sub
B4X:
Sub Activity_Resume
' svPeople.Initialize(500dip)
' Activity.LoadLayout("LayoutPeople")
For i = 9 To 0 Step -1
Dim et As EditText
et.Initialize("et")
svPeople.Panel.AddView(et,5dip, 5dip+i*50dip, 310dip, 40dip)
et.SingleLine = True
et.Tag = i
If statePaused = False Then
If i < Main.lstupeople.Size Then
et.Text = Main.lstupeople.Get(i)
End If
Else
et.Text = Main.lsttemp.Get(i)
End If
Next
End Sub
B4X:
Sub Activity_Pause (UserClosed As Boolean)
If UserClosed = False Then
statePaused = True
Dim et As EditText
Main.lsttemp.Initialize
For i = 9 To 0 Step -1
et = svPeople.Panel.GetView(i)
Main.lsttemp.Add(et.text)
Next
Else
statePaused = False
Activity.Finish
End If
End Sub
Attachments
Last edited by a moderator: