Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Detect UI mode is TV or not
import android.content.res.Configuration;
* Created by fung.lam on 27/07/2015.
public class DefaultApplication extends Application {
private boolean isRunningOnTv(){
UiModeManager uiModeManager = (UiModeManager) getSystemService(UI_MODE_SERVICE);
return uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.