您的位置:首页 > 移动开发 > Android开发

Android 打开状态栏 EXPAND_STATUS_BAR

2013-08-14 16:00 363 查看
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){
          
        }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐