Problem with back button in VideoView

后端 未结 5 572
感动是毒
感动是毒 2021-01-05 08:03

I am having difficulty getting the back button to actually finish my activity when pressed. I am running a very simple videoview, using a progressdialog to show loading dial

5条回答
  •  长情又很酷
    2021-01-05 08:36

    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            System.exit(0);
        }
    
        return false;
    }
    

提交回复
热议问题