How to find out if in Car Mode (Android)?

眉间皱痕 提交于 2019-12-01 05:49:00

问题


is it actually possible to find out via intent (or something else) if the device is currently in Car Mode? I tried to do this with a receiver that has a global variable, however I guess the variable doesn't survive after going through the onReceive ;-)

So is there another way?

Thanks!


回答1:


I got this link after googling for

Configuration UI_MODE_TYPE_CAR

. Link - http://www.java2s.com/Open-Source/Android/Samples/techbooster/org/jpn/techbooster/sample/uiModeManager.java.htm

It mentions

getSystemService(Context.UI_MODE_SERVICE).getCurrentModeType() will return Configuration.UI_MODE_TYPE_CAR if it is the case.



来源:https://stackoverflow.com/questions/6508428/how-to-find-out-if-in-car-mode-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!