Android Question Wait Problem

edgar_ortiz

Active Member
Licensed User
Longtime User
Hi,

I need to capture multiple fields on one screen and verify their content.

Before it worked fine with MsgBox ... now using Msgbox2Async and it doesn't work.

The idea is to verify:
- Verify Field1, when finished verifying
- Verify Field2, when finished verifying
- Verify Field3, when finished verifying

Show if there are errors.
Logger connected to: samsung SM-A305G
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Begin: Num1_EnterPressed
End: Num1_EnterPressed
Begin: Num2_EnterPressed
End: Num2_EnterPressed
Begin: Num3_EnterPressed
End: Num3_EnterPressed
--> Begin: Check all fields
Begin: Num1_EnterPressed
Finished checking Num1
Begin: Num2_EnterPressed
End: Num2_EnterPressed
Finished checking Num2
Begin: Num3_EnterPressed
Finished checking Num3
--> End: Check all fields
Data is Wrong
End: Num3_EnterPressed
--> Begin: Check all fields
Begin: Num1_EnterPressed
Finished checking Num1
Begin: Num2_EnterPressed
End: Num2_EnterPressed
Finished checking Num2
Begin: Num3_EnterPressed
Finished checking Num3
--> End: Check all fields
Data is Wrong
End: Num3_EnterPressed
** Activity (main) Pause, UserClosed = true **
I do not know what I'm doing wrong.

TIA,

Edgar
 

Attachments

  • Wait_Problem.zip
    9.8 KB · Views: 180

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
The problem is your enter pressed routine returns back to your calling procedure (btnProcess_Click) as soon as the wait for is executed. Once the user clicks the message box the enter pressed routine then continues to execute. See @Erel's video on resumable subs:
Generally I have a separate validation routine that returns a CSBuilder that contains all of the detected errors so they can be displayed in one message box. There are many ways to solve your issue, search the forum for msgboxasync and I'm sure you'll get several ideas.
 
Upvote 0
Top