如何通过Intent打开或展开状态栏?
我正在制作一个家庭应用程序,我认为如果我使用全屏并且不显示状态栏,它将是合适的。所以现在我希望能够使用菜单上的按钮打开或展开状态栏,类似于某些默认家庭应用程序在菜单中的方式。我知道这是可能的,因为默认主页就是这样做的。这是出于意图吗?如果可以的话我可以有它的代码吗?如果不好,那么如果你们告诉我如何做,我将不胜感激。谢谢!
I am making a home application and I think that it will be suitable if I use a fullscreen and not show the status bar. So now I want to be able to open or expand the status bar with a button on the menu, similar to the way some default home applications have in the menu. I know its possible since the default home does it. Is this done through an intent? If so can I have the code for it. If not well then I would appreciate it if you guys showed me how. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看看这是否有帮助并让我知道......
See if this helps and let me know...
下面的代码对我有用:
The code below works for me:
这个对我有用:
清单:
代码:
但是,有人写它不适用于所有设备和 Android 版本(此处),所以我写了一个请求为此添加官方 API,此处。
This one worked for me:
manifest:
Code:
However, someone wrote it doesn't work on all devices and Android versions (here), so I wrote a request to add official API for this, here.