Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Remove the status bar
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN
setContentView(R.layout.activity_main)
previewView = findViewById( R.id.camera_preview_view )
if (ActivityCompat.checkSelfPermission( this , Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
requestCameraPermission()
}
else {
// Permission granted, start the camera live feed
setupCameraProvider()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment