检测何时可穿戴设备变为 theater/cinema 模式
Detect when wearable changed into theater/cinema mode
有没有人找到一种方法来检测到这种模式的变化。我找不到它的任何事件,但了解我的应用程序会很方便。
Android 框架不会公开这些信息。但是,如果您想尊重此设置并且在影院模式开启时不打扰用户(我想这就是您问的原因),您可以尝试使用非官方方式进行试验。
THEATER_MODE_ON
定义在 Settings.Global
, but it's hidden. However, you should be able to still access it with Settings.Global.getInt(ContentResolver, String)
if you just use the string theater_mode_on
. Check the constant on grepcode: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.1.0_r1/android/provider/Settings.java#5104
您也可以尝试设置一个内容观察器,因为您知道常量值。但是,请记住,这是非官方的,@hide
API 因此您的应用可能会在未来的版本中损坏。
有没有人找到一种方法来检测到这种模式的变化。我找不到它的任何事件,但了解我的应用程序会很方便。
Android 框架不会公开这些信息。但是,如果您想尊重此设置并且在影院模式开启时不打扰用户(我想这就是您问的原因),您可以尝试使用非官方方式进行试验。
THEATER_MODE_ON
定义在 Settings.Global
, but it's hidden. However, you should be able to still access it with Settings.Global.getInt(ContentResolver, String)
if you just use the string theater_mode_on
. Check the constant on grepcode: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.1.0_r1/android/provider/Settings.java#5104
您也可以尝试设置一个内容观察器,因为您知道常量值。但是,请记住,这是非官方的,@hide
API 因此您的应用可能会在未来的版本中损坏。