Created
March 21, 2022 10:51
-
-
Save laurentyhuel/d343d6e56b65619516a8ea4103a2473a 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