Android Question ExoPlayer problem

shb777

Active Member
Licensed User
Longtime User
I'm writing a program to play video files with Exoplayer. I want them to play full screen. But the only way
I can stop the video playing, is to have a button named stop, that does it. But i don't want any button visible when I'm playing the video. I tried using the back navigate button, but it's doing what android wants it to do, minimize my program, which I don't want to do.


B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean
    If KeyCode = KeyCodes.KEYCODE_BACK Then                           
        Buttonstop_click

    Else
        Return False
    End If
End Sub

So I want the back navigation button to execute my code, but not androids. How do I do that?
 

Pendrush

Well-Known Member
Licensed User
Longtime User
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean
    If KeyCode = KeyCodes.KEYCODE_BACK Then                           
        Buttonstop_click
        Return True '<--- ADD THIS LINE TO CONSUME EVENT
    Else
        Return False
    End If
End Sub
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User

Thanks a lot! It worked. I noticed that that there was a Return False in the Else part, and I thought it might be something like that.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…