Android 打开状态栏 EXPAND_STATUS_BAR

    try{  
      
        Object service = context.getSystemService("statusbar");  
        Class<?> statusBarManager = Class.forName("android.app.StatusBarManager");  
        Method expand = statusBarManager.getMethod("expand");  
        expand.invoke(service);  
        Log.d("click", "-------------2");  
    }catch(NoSuchMethodException e)  
    {  
        try{  
          
            Object obj = context.getSystemService("statusbar");  
            Class.forName("android.app.StatusBarManager")  
                    .getMethod("expandNotificationsPanel", new Class[0])  
                    .invoke(obj, (Object[]) null);  
            Log.d("click", "-------------3");  
      
        }catch(Exception e2){  
                   
        }  
      
    }catch(Exception e){  
        
    }  

你可能感兴趣的:(android,状态栏,打开)