Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save laurentyhuel/d343d6e56b65619516a8ea4103a2473a to your computer and use it in GitHub Desktop.
Save laurentyhuel/d343d6e56b65619516a8ea4103a2473a 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