Skip to content

Instantly share code, notes, and snippets.

@laurentyhuel
Created May 9, 2022 08:17
Show Gist options
  • Save laurentyhuel/cd877160f6d9e31c4f3e8bee981a7ed0 to your computer and use it in GitHub Desktop.
Save laurentyhuel/cd877160f6d9e31c4f3e8bee981a7ed0 to your computer and use it in GitHub Desktop.
2xScreen : getCustomerDisplay
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