Android Question Problem with MsgBox & MsgBox2

vfafou

Active Member
Licensed User
Hello!
I have a strange problem:
As you can see at the code below, I use 2 MsgBoxes.
When I run my application at Debug(rapid) mode, they appear and I can make my choices.
When running at runtime, they are ignored and the code continues to execute without taking the value of my choice! What is wrong? Can I do something, or this is a normal behavior?
Thank you in advance!
B4X:
Sub CheckActive(CMsg As String)
    Dim i As Int
    Dim MP As MediaPlayer
  
    MP.Initialize
  
    Try
        MP.Load(RingM.GetContentDir,RingM.GetDefault(RingM.TYPE_NOTIFICATION))
    Catch
        Log("Invalid File")
    End Try
  
    Select Case mBAction
        Case "PO"
            mBCol1 = Strings.SplitGetWord(CMsg,";",5)
            i = Msgbox2("Attention! <" & mBCol1  & "> is already active!", "Title","OK","","",Null)
            ButtonsAct(False)
            IsActive = False
          
        Case "OW"
            mBCol1 = Strings.SplitGetWord(CMsg,";",5)
            i = Msgbox2("Attention! <" & mBCol1  & "> is already active. Do you really want to activate?", "Title", "Yes","","No", Null)
            Select Case i
                Case DialogResponse.POSITIVE
                    CallSub3(PushService.wsh,"SendMessageToServer","FA",UserID)
                Case DialogResponse.NEGATIVE
                    IsActive = False
                    ButtonsAct(False)
            End Select
    End Select
  
    mBAction = ""
    mBCol1   = ""
    mBCol2   = ""
    mRTID     = ""
    mRTInf     = 0
  
    MP.Play
  
End Sub
 

vfafou

Active Member
Licensed User
Hello Erel!
I finally found that if I start a service before showing the MsgBox, then the MsgBox will never appear!
I've changed the sequence of my code so service is started after showing the MsgBox.
The strange thing is that I've not seen the same behavior at debug mode!
 
Upvote 0
Top