检测从服务改变屏幕方向 [英] Detecting screen orientation change from service
本文介绍了检测从服务改变屏幕方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
一个pretty简单而直接的问题...有可能是一个服务检测到屏幕方向的变化?如果是这样,怎么样?
A pretty simple and straightforward question... is it possible for a service to detect screen orientation changes? If so, how?
推荐答案
这个链接将回答你的问题:<一href=\"http://stackoverflow.com/questions/4625167/how-do-i-use-a-service-to-monitor-orientation-change-in-android\">How我用一个服务来监视的Android 方向变化
This link will answer your question: How do I use a service to monitor Orientation change in Android
您还可以创建一个广播接收器
侦听 Intent.ACTION_CONFIGURATION_CHANGED
(机器人.intent.action.CONFIGURATION_CHANGED
)
You can also create a BroadcastReceiver
that listens for Intent.ACTION_CONFIGURATION_CHANGED
("android.intent.action.CONFIGURATION_CHANGED"
)
这篇关于检测从服务改变屏幕方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文