如何检测设备何时进入Android N的多窗口模式 [英] How to detect when device goes to multi-window mode of Android N

查看:103
本文介绍了如何检测设备何时进入Android N的多窗口模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户切换到多窗口模式时,我想从后台服务中得到通知.除了流程中涉及的活动之外,是否有其他方法可以通过服务获取此信息.

I want to get notified from my background service when the user switches to multi-window mode. Is there a way to get this information by a service other than the activities involved in the process.

我还注意到,在前景窗口的区域上单击覆盖层时,它会自动切换到该区域下的活动.可以预防吗?

Also I have noticed that when an overlay is clicked on the area of the foreground window it automatically switches to the activity under the area. Can this be prevented?

推荐答案

您必须添加ViewTreeObserver.并检查设备是否进入多窗口模式 getActivity().isInMultiWindowMode()

You must add ViewTreeObserver. And check if device enter in Multi-Window mode getActivity().isInMultiWindowMode()

这篇关于如何检测设备何时进入Android N的多窗口模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆