2012-09-15 68 views
3

有没有办法显示android状态栏,当它隐藏的服务?通过显示,我的意思是只在屏幕顶部的酒吧,而不是扩大通知区域。如何以编程方式显示Android状态栏?

Play Store中的智能状态栏以某种方式在没有根的情况下执行此操作。

另外,我也试图用下面的代码扩展状态栏通知:

Object service = mContext.getSystemService("statusbar"); 
Class<?> statusbarManager = Class.forName("android.app.StatusBarManager"); 
Method expand = statusbarManager.getMethod("expand"); 
expand.invoke(service); 

具有所需权限。但似乎没有发生。

任何帮助,将不胜感激!

+0

你在mContext中存储哪些上下文?在这里更好地使用'getApplicationContext()'; –

回答

0

原来是JB限制。如果应用程序是全屏,则原始方法无法展开状态栏。

相关问题