Android Question Just ask why is deprecated msgbox

edgar_ortiz

Active Member
Licensed User
Longtime User
Hi to all,

Does anyone know why msgbox is obsolete or the problems that using it can cause?

Regards,

Edgar

P.D.:
For me msgbox is one of the best functionalities to interact with the user.

:(
 

JohnC

Expert
Licensed User
Longtime User
From what I understand, calling MsgBox blocks the UI thread in your app which can cause various problems under certain conditions.

So you should use MsgBoxAync instead because it allows the thread to continue running, and it is a direct replacement for MsgBox (same parameters).

It's true that the new MsgBoxAsync won't immediately pause the flow of code in your app like the old MsgBox did, but the below work-around can simulate that pause:

B4X:
   MsgboxAsync("What you want to say","MsgBox Title")
   Wait For MsgBox_Result (Result As Int)

NOTE: You can't use the above work-around in Code Modules because you need to catch the "MsgBox_Result" event (via the Wait For), and that can only be done in services and activities.
 
Last edited:
Upvote 0
Top