Created
January 4, 2019 08:04
-
-
Save michael-riha/dd8a90bbfda5c411f0b7ce81d148816e to your computer and use it in GitHub Desktop.
Check for a TV device - https://developer.android.com/training/tv/start/hardware
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
public static final String TAG = "DeviceTypeRuntimeCheck"; | |
UiModeManager uiModeManager = (UiModeManager) getSystemService(UI_MODE_SERVICE); | |
if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) { | |
Log.d(TAG, "Running on a TV Device"); | |
} else { | |
Log.d(TAG, "Running on a non-TV Device"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment