Disable back button in VrVideoView Cardboard-Mode in Android SDK

青春壹個敷衍的年華 提交于 2019-12-12 05:37:04

问题


I'm developing an Android app for a controlled environment in which the user should not be allowed to exit the VrVideoView's full screen cardboard mode.

By entering the cardboard mode the SDK seems to present its own activity so I cannot simply override on onBackPressed.

Is there a way to prevent this?


回答1:


By poking around in the innards you can get your hands on the dialog (yes, it's a dialog) and disable the back button:

vrView = (VrVideoView) findViewById(R.id.videoView);
vrView.fullScreenDialog.setCancelable(false);


来源:https://stackoverflow.com/questions/40191666/disable-back-button-in-vrvideoview-cardboard-mode-in-android-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!