Android Question MsgBox and MsgBox2 depreciation

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi all.

I have a question - is there any way other then manually to replace MsgBox and MsgBox2 that already in my code?
I know that I can replace them with MsgBoxAsync and MsgBoxAsync2 but I want MsgBoxAsync to do the same as MsgBox does.
I understand a difference between them and I know that I can add Wait For next to MsgBoxAsync line.

But doing so in many places in my code will take a lot of time.

So my question is - is there any way to do something similar to
B4X:
Public Sub MsgBox(str As String,strTitle As String)

    MsgboxAsync(str,strTitle)
    Wait For Msgbox_Result (Result As Int)
    If Result = DialogResponse.POSITIVE Then
        Log("BBB " & DateTime.Now)
    End If

End Sub

I tried to do so in static module - got an error that msgbox is not valid identifier.
Well, tried to change it to

B4X:
Public Sub MsgBoxNew(str As String,strTitle As String)

    MsgboxAsync(str,strTitle)
    Wait For Msgbox_Result (Result As Int)
    If Result = DialogResponse.POSITIVE Then
        Log("BBB " & DateTime.Now)
    End If

End Sub

and then replace all lines with MsgBox to MsgBoxNew. Didn't work either - static module can't handle events.

It does work in class but it will require me to add a reference to this class in every activity and in static modules.

Thanks
 
Top