Android Question Strange Button Behavior

jmoeller

Member
Licensed User
Longtime User
I am developing an app for low literacy users. I have three buttons on the screen which I want read to the user. I want to show which button corresponds to the instructions, so I want to turn the button red while the corresponding audio plays.
Here is my code...
B4X:
AgreeButton.Color = Colors.Red
'Msgbox("turn it red", "Notification")   
sp.Load(File.DirAssets,"agree.mp3")
sp.Play
AgreeButton.Color = Colors.Gray

As listed, the code doesn't change the color of the button. However, if I uncomment the "Msgbox" line, it changes the button color to red.

Any idea what is happening here?
 

Cableguy

Expert
Licensed User
Longtime User
the notification is giving the underlying SO the time needed for the change to be noticeable!
you are change the color of the button in a rapid sequence, which, without the message notification its takes the last color change almost immediatly
 
Upvote 0
Top