Hello
I've been trying to rotate the App in android tv based on selection.
But the code has no impact in TV
buttonLandscape.setOnClickListener {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
Toast.makeText(baseContext, "Landscape Orientation", Toast.LENGTH_SHORT).show()
}
buttonPortrait.setOnClickListener {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
Toast.makeText(baseContext, "Portrait Orientation", Toast.LENGTH_SHORT).show()
}
I'm using Kotlin
Can anyone help ?
I've been trying to rotate the App in android tv based on selection.
But the code has no impact in TV
buttonLandscape.setOnClickListener {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
Toast.makeText(baseContext, "Landscape Orientation", Toast.LENGTH_SHORT).show()
}
buttonPortrait.setOnClickListener {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
Toast.makeText(baseContext, "Portrait Orientation", Toast.LENGTH_SHORT).show()
}
I'm using Kotlin
Can anyone help ?