Android Question Button Lag

JOFA666

Member
Licensed User
Longtime User
I am using a button and modifying the background image when the Down, Up and Click event occurs. The problem I am encountering is serious lag. It takes some considerable time for the background image to change, making the program feel very, very laggy. The code looks as follows:

B4X:
Sub ButtonDot1_Down
    If ButtonDot1Selected = True Then
        ButtonDot1.SetBackgroundImage(LoadBitmap(File.DirAssets, "ButtonSelectedDown.png"))
    Else
        ButtonDot1.SetBackgroundImage(LoadBitmap(File.DirAssets, "ButtonDown.png"))
    End If   
End Sub

Similar code is used for the Up and Click events. I wanted to originally use an ImageView for this, but it does not support Up and Down events. Thus, my question is, can I somehow overcome this lag, or is there a better option that I am missing?
 
Top