Android Question MsgBox Text on Android 6.0

SjaiuwaSALjw

New Member
Licensed User
Longtime User
Hi!

I have a MsgBox on my application and i have realised that the text isn't showing on Android 6.0 devices, but on other android versions it is.

My SdkVersion is set to 23, and this is the code of the dialog

B4X:
If gpsClient.GPSEnabled=False Then
    ret = Msgbox2("GPS Disabled. Enable?", "GPS Disabled", "YES", "", "NO", Null)
    Select ret
        Case DialogResponse.POSITIVE
        StartActivity(gpsClient.LocationSettingsIntent)
    End Select
End If

The MsgBox always appears, but on android 6.0 shows an empty MsgBox with the buttons YES and NO.

Why is that?

Thank you,
Gerard
 

SjaiuwaSALjw

New Member
Licensed User
Longtime User
This code isn't working for me:

If you use the string collector (ret) sometimes shows the MsgBox empty, and sometimes just goes out the sub.
Without "ret" (Your code, Erel) the app show the MsgBox empty.

It happens with MsgBox and MsgBox2 too.
 
Upvote 0

SjaiuwaSALjw

New Member
Licensed User
Longtime User
I found it.

The problem was that i didn't had defined a theme for the AlertDialog.

So I've made a few changes:

HTML:
<style name="MyTheme" parent="android:Theme.Material.Light">
    <item name="android:alertDialogTheme">@style/MyAlertDialogTheme</item>
</style>
  
<style name="MyAlertDialogTheme">
    <item name="android:windowIsFloating">true</item>
    <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
    <item name="android:textColor">#000000</item>
</style>

EDIT: What happened was that the dialog worked fine, but the text color was white :p

And MsgBox it's working fine too now that i'm using B4A 6.0. I was using the BETA version before...
 
Upvote 0
Top