如何打开或通过有意扩大状态栏? [英] How to open or expand status bar through intent?
本文介绍了如何打开或通过有意扩大状态栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想提出一个家庭的应用程序,我想,如果我使用全屏,而不是显示在状态栏这将是合适的。所以,现在我希望能够打开或扩大与菜单,类似这样的一些默认主页的应用程序在菜单上的一个按钮的状态栏。我知道它可能的,因为默认主做的。这是通过一个意图做了什么?如果这样我就可以有code吧。如果没有很好的话,我会AP preciate,如果你们教我如何。谢谢!
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!
推荐答案
看看这有助于让我知道...
See if this helps and let me know...
try{
Object service = getSystemService("statusbar");
Class<?> statusbarManager = Class.forName("android.app.StatusBarManager");
Method expand = statusbarManager.getMethod("expand");
expand.invoke(service);
}
catch(Exception ex){
....
}
uses permission : "android.permission.EXPAND_STATUS_BAR";
这篇关于如何打开或通过有意扩大状态栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文