I can not expand statusbar no my nexus 4 with android 4.2,but other level is running OK ,My code is:
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) {
}
}
And
How can I do ?