Created
May 9, 2022 08:17
-
-
Save laurentyhuel/cd877160f6d9e31c4f3e8bee981a7ed0 to your computer and use it in GitHub Desktop.
2xScreen : getCustomerDisplay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun getCustomerDisplay(context: Context): Display? { | |
val displayManager = context.getSystemService(Context.DISPLAY_SERVICE) as DisplayManager | |
val displays = displayManager.displays | |
if (displays.size <= 1) { | |
return null | |
} | |
// We take the first additional screen | |
return displays[1] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment