shb777 Active Member Licensed User Longtime User Feb 17, 2018 #1 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. Code: Copy 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?
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. Code: Copy 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 Feb 17, 2018 #2 Code: Copy 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
Code: Copy 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
shb777 Active Member Licensed User Longtime User Feb 17, 2018 #3 Pendrush said: Code: Copy 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 Click to expand... 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
Pendrush said: Code: Copy 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 Click to expand... 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.