My application allows me to run another application with me. None of my actions show a status bar. But when you start other applications, such as Camera, the user can access status bar. So I tried the following code snippet to collapse status barinside the service (so it collapses every time, and the code always works).
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
Object service = getSystemService("statusbar");
Class<?> statusbarManager = Class.forName("android.app.StatusBarManager");
Method collapse = null;
if(currentapiVersion <= 16){
collapse = statusbarManager.getMethod("collapse");
}else{
collapse = statusbarManager.getMethod("collapsePanels");
}
collapse.setAccessible(true);
collapse.invoke(service);
Now I want to collapse status baronly if the user tries to expand this.Is exist intentor intent filterto detect the extension status bar?
Thanks at Advance
source
share