Android Question Passing results between modules

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:
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
Then in Main this is supposed to display the results on a label (lblDetails) on the main screen:
B4X:
public Sub NewPatient(pname As String)
    lblDetails.Text = pname
End Sub
But nothing happens on returning from the Patient info screen. What am I doing wrong?
 
I dont think I can - I need Portrait with one activity and Landscape with another:
(It does have some limitations. One notable limitation is that in B4A, the activity that holds all the pages should be locked to a single orientation)
 
Upvote 0
Top