Android Question How to change the background color of MsgBox2?

tuhatinhvn

Active Member
Licensed User
Longtime User
B4X:
Sub FixMsgboxCorner(sf As Object)
    Dim jo As JavaObject = sf
    Dim cd2 As ColorDrawable
    cd2.Initialize2(Colors.Blue, 10dip, 0dip, Colors.ARGB(45,0,0,0))
    jo.RunMethodJO("getWindow", Null).RunMethod("setBackgroundDrawable", Array(cd2))
End Sub

Use:

B4X:
Dim sf As Object = Msgbox2Async("Disclaim", "Title", "Yes", "Cancel", "No", Null, False)
        FixMsgboxCorner(sf)
        Wait For (sf) Msgbox_Result (Result As Int)
        If Result = DialogResponse.POSITIVE Then
            Log(POSITIVE)
            '...
        End If
 
Upvote 0
Top