Peter Finch
Member
Hi everyone, sorry to be thickand getting senile - I love B4A and have an app to receive bluetooth data from my (ESP32) ECG device (ADS1293 AFE to ESP32 to app. I have tried to add a very simple module to add Patient details and return them to the main Module/screen for display but cannot pass the data from the simple layout with P_Name, P_Sex, P_Age EditText fields, back.
I have a "Back" arrow button (defined as Imageview) and this code to strip data from the form:
Then in Main this is supposed to display the results on a label (lblDetails) on the main screen:
But nothing happens on returning from the Patient info screen. What am I doing wrong?
I have a "Back" arrow button (defined as Imageview) and this code to strip data from the form:
B4X:
'In Globals
Private NewName As String
Private Sub Back_Click
'send data back to Main
Dim sb As StringBuilder
sb.Initialize
sb.Append(P_Name.Text).Append(" (").Append(P_Sex.Text).Append(") ").Append(P_Age.Text)
NewName = sb.ToString
CallSub2(Main, "NewPatient", NewName)
Activity.Finish
End Sub
B4X:
public Sub NewPatient(pname As String)
lblDetails.Text = pname
End Sub