++wythern++

X presents Y for a better Z

Android intent-filter 不能收到 ACTION_SCREEN_ON/OFF intent

这里有解释

Android does not seem to support manifest-registered receivers for cases where they really do not want to start up a new process. For example, you will see the same effect with the battery info actions (e.g., BATTERY_LOW). Beyond that, though, I don't have much rationale -- I didn't write it. :-) – CommonsWare Oct 19 '09 at 12:50

在某些intent broadcasting case下android不希望产生新的process(可能会导致系统响应慢),SCREEN_ON / OFF 就属于这样的case。
所以在自己的activity里面registerReceiver()是处理这样的case的正确选择。

posted on 2013-03-27 16:05 wythern 阅读(1312) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理