我无法使用 android 4.2 扩展状态栏 no my nexus 4,但其他级别运行正常,我的代码是:
public void OpenNotify() {
// TODO Auto-generated method stub
int currentApiVersion = android.os.Build.VERSION.SDK_INT;
try {
Object service = getSystemService("statusbar");
Class<?> statusbarManager = Class.forName("android.app.StatusBarManager");
if (service != null) {
/*Method expand = service.getClass()statusbarManager.getMethod("expand");
expand.invoke(service);*/
if (currentApiVersion <= 16) {
Method collapse = statusbarManager.getMethod("collapse");
collapse.setAccessible(true);
collapse.invoke(service);
} else {
Method collapse2 = statusbarManager.getMethod("collapsePanels");
collapse2.setAccessible(true);
collapse2.invoke(service);
}
}
} catch (Exception e) {
}
}
和
我能怎么做 ?